mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 15:08:24 +00:00
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:
co-authored by
Claude Fable 5.1
parent
e3afc28fc3
commit
2da12e71ac
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user