mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 15:08:24 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user