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 <noreply@anthropic.com>
This commit is contained in:
DanConwayDev
2026-09-18 14:33:10 +00:00
co-authored by Claude Fable 5.1
parent e3afc28fc3
commit 2da12e71ac
-12
View File
@@ -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,