upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/sync/maintainer_reprocessing.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sync/maintainer_reprocessing.rs')
-rw-r--r--tests/sync/maintainer_reprocessing.rs25
1 files changed, 14 insertions, 11 deletions
diff --git a/tests/sync/maintainer_reprocessing.rs b/tests/sync/maintainer_reprocessing.rs
index ff1eb43..9154ee5 100644
--- a/tests/sync/maintainer_reprocessing.rs
+++ b/tests/sync/maintainer_reprocessing.rs
@@ -70,17 +70,15 @@ async fn test_maintainer_announcement_reprocessed_immediately() {
70 identifier 70 identifier
71 )], 71 )],
72 ), 72 ),
73 Tag::custom( 73 Tag::custom(TagKind::custom("relays"), vec![relay_a.url().to_string()]),
74 TagKind::custom("relays"),
75 vec![relay_a.url().to_string()],
76 ),
77 ]) 74 ])
78 .sign_with_keys(&maintainer_keys) 75 .sign_with_keys(&maintainer_keys)
79 .unwrap(); 76 .unwrap();
80 send_to_relay(&relay_a, &maintainer_announcement).await.unwrap(); 77 send_to_relay(&relay_a, &maintainer_announcement)
78 .await
79 .unwrap();
81 let _git_dir_maintainer = 80 let _git_dir_maintainer =
82 push_git_data_to_relay(&relay_a, &maintainer_keys, identifier, &[&relay_a.domain()]) 81 push_git_data_to_relay(&relay_a, &maintainer_keys, identifier, &[&relay_a.domain()]).await;
83 .await;
84 println!("✓ Maintainer announcement + git data pushed to relay_a"); 82 println!("✓ Maintainer announcement + git data pushed to relay_a");
85 83
86 // Step 2: Start relay_b with relay_a as bootstrap so its SyncManager connects immediately. 84 // Step 2: Start relay_b with relay_a as bootstrap so its SyncManager connects immediately.
@@ -134,7 +132,9 @@ async fn test_maintainer_announcement_reprocessed_immediately() {
134 // re-processing of the maintainer announcement via our new code path. 132 // re-processing of the maintainer announcement via our new code path.
135 let _git_dir_owner = 133 let _git_dir_owner =
136 push_git_data_to_relay(&relay_b, &owner_keys, identifier, &[&relay_b.domain()]).await; 134 push_git_data_to_relay(&relay_b, &owner_keys, identifier, &[&relay_b.domain()]).await;
137 println!("✓ Owner git data pushed to relay_b (owner announcement promoted, hot cache re-processed)"); 135 println!(
136 "✓ Owner git data pushed to relay_b (owner announcement promoted, hot cache re-processed)"
137 );
138 138
139 // Step 5: Wait briefly for async processing to complete. 139 // Step 5: Wait briefly for async processing to complete.
140 tokio::time::sleep(Duration::from_secs(1)).await; 140 tokio::time::sleep(Duration::from_secs(1)).await;
@@ -363,9 +363,12 @@ async fn test_multiple_maintainers_all_reprocessed() {
363 .kind(Kind::GitRepoAnnouncement) 363 .kind(Kind::GitRepoAnnouncement)
364 .author(keys.public_key()) 364 .author(keys.public_key())
365 .identifier(identifier); 365 .identifier(identifier);
366 let found = 366 let found = wait_for_event_on_relay(relay_a.url(), filter, Duration::from_secs(10)).await;
367 wait_for_event_on_relay(relay_a.url(), filter, Duration::from_secs(10)).await; 367 assert!(
368 assert!(found, "{} announcement should be in relay_a before starting relay_b", name); 368 found,
369 "{} announcement should be in relay_a before starting relay_b",
370 name
371 );
369 } 372 }
370 println!("✓ All three maintainer announcements confirmed in relay_a's DB"); 373 println!("✓ All three maintainer announcements confirmed in relay_a's DB");
371 374