diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-10 17:11:52 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-10 17:11:52 +0000 |
| commit | b6c908599c1e63852b8d3b4b20caae344e37a34a (patch) | |
| tree | cb1e58858610ef8fc952cce54eba41e77b67d2db /tests/sync/bootstrap.rs | |
| parent | d3d0b28b0ba07f5572151e82339ab8871ff34e52 (diff) | |
test(sync): add wait_for_sync_connection helper for improved reliability
Diffstat (limited to 'tests/sync/bootstrap.rs')
| -rw-r--r-- | tests/sync/bootstrap.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/sync/bootstrap.rs b/tests/sync/bootstrap.rs index 506a262..0d68609 100644 --- a/tests/sync/bootstrap.rs +++ b/tests/sync/bootstrap.rs | |||
| @@ -246,7 +246,11 @@ async fn test_announcement_not_listing_relay_is_not_synced() { | |||
| 246 | let keys = Keys::generate(); | 246 | let keys = Keys::generate(); |
| 247 | 247 | ||
| 248 | // 4. Wait for relay_b's sync connection to establish | 248 | // 4. Wait for relay_b's sync connection to establish |
| 249 | tokio::time::sleep(Duration::from_secs(1)).await; | 249 | // Use the sync connection helper for more reliable connection verification |
| 250 | match wait_for_sync_connection(relay_b.url(), 1, Duration::from_secs(5)).await { | ||
| 251 | Ok(()) => println!("Sync connection established (verified via metrics)"), | ||
| 252 | Err(e) => println!("Sync connection check: {} (continuing with test)", e), | ||
| 253 | } | ||
| 250 | 254 | ||
| 251 | // 5. Create a repository announcement that lists ONLY relay_a | 255 | // 5. Create a repository announcement that lists ONLY relay_a |
| 252 | // This should NOT sync to relay_b because relay_b's write policy | 256 | // This should NOT sync to relay_b because relay_b's write policy |