From 6c262b0999b2b59839a22906bd07773b1fb8b61f Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 22 Jul 2026 15:50:56 +0000 Subject: [PATCH] test: remove purgatory promotion pacing Exercise the direct event and git-push path without fixed setup sleeps so the test relies on observable promotion instead of timing. --- tests/purgatory_sync.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/purgatory_sync.rs b/tests/purgatory_sync.rs index 960bf23..933884e 100644 --- a/tests/purgatory_sync.rs +++ b/tests/purgatory_sync.rs @@ -71,18 +71,12 @@ async fn test_push_triggers_unified_processing() { .expect("Failed to add relay"); client.connect().await; - // Wait for connection to be established - tokio::time::sleep(Duration::from_millis(500)).await; - // Send announcement client .send_event(&announcement) .await .expect("Failed to send announcement"); - // Small delay to ensure announcement is processed - tokio::time::sleep(Duration::from_millis(200)).await; - // 4. Create and send state event referencing the commit // The state event has refs that point to commits we haven't pushed yet let npub = keys.public_key().to_bech32().expect("Failed to get npub"); @@ -104,9 +98,9 @@ async fn test_push_triggers_unified_processing() { .await .expect("Failed to send state event"); - // 5. Verify event is NOT served yet (in purgatory) - // Give a moment for the event to be processed into purgatory - tokio::time::sleep(Duration::from_millis(200)).await; + // 5. Verify event is NOT served yet (in purgatory). Deliberately add no + // pacing between accepting the state event and this check or the push: + // the post-push promotion path must handle either arrival ordering. verify_event_not_served(relay.url(), &state_event_id, Duration::from_secs(1)) .await