From 2da12e71acbe31c8222fd389ed685f76b9a8b4d9 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 18 Sep 2026 14:33:10 +0000 Subject: [PATCH] test(state): drop the pauses after announcement sends Six tests paused 100 ms after sending an announcement "for it to be processed" before sending the state event whose admission depends on it. The relay runs the announcement through its write policy before it replies `OK`, so the awaited send already orders the two admissions and the pause only added 100 ms per test. Remove the pauses. The state-event assertions that follow are unchanged. Validation: measured against master with the same binaries, 20 unloaded runs and 30 samples as three concurrent instances under CPU spinners; see the pull request description. Assisted-by: Claude Fable 5.1 Co-Authored-By: Claude Fable 5.1 --- tests/state_authorization.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/state_authorization.rs b/tests/state_authorization.rs index 47fdb9f..408018d 100644 --- a/tests/state_authorization.rs +++ b/tests/state_authorization.rs @@ -92,9 +92,6 @@ async fn test_reject_state_from_unauthorized_author() { // Send announcement client.send_event(&announcement).await.unwrap(); - // Wait for announcement to be processed - tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; - // Try to send state event from unauthorized author let state_event = EventBuilder::new(Kind::RepoState, "") .tags([ @@ -156,9 +153,6 @@ async fn test_accept_state_from_announcement_author() { // Send announcement client.send_event(&announcement).await.unwrap(); - // Wait for announcement to be processed - tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; - // Send state event from same author (should be accepted or go to purgatory) let state_event = EventBuilder::new(Kind::RepoState, "") .tags([ @@ -238,9 +232,6 @@ async fn test_accept_state_from_maintainer() { client.send_event(&announcement).await.unwrap(); client.send_event(&reciprocal_announcement).await.unwrap(); - // Wait for announcements to be processed - tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; - // Send state event from maintainer let state_event = EventBuilder::new(Kind::RepoState, "") .tags([ @@ -396,7 +387,6 @@ async fn test_reject_state_from_invited_maintainer() { client.connect().await; client.send_event(&announcement).await.unwrap(); - tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; assert!( state_event_rejected_as_unauthorized(&client, &maintainer_keys).await, @@ -444,7 +434,6 @@ async fn test_accept_state_from_role_tag_maintainer() { client.send_event(&announcement).await.unwrap(); client.send_event(&reciprocal_announcement).await.unwrap(); - tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; assert!( !state_event_rejected_as_unauthorized(&client, &maintainer_keys).await, @@ -502,7 +491,6 @@ async fn test_reject_state_from_removed_maintainer() { client.send_event(&announcement).await.unwrap(); let _ = client.send_event(&reciprocal_announcement).await; - tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; assert!( state_event_rejected_as_unauthorized(&client, &maintainer_keys).await,