diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 16:53:03 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 16:53:03 +0000 |
| commit | 2a9160836bb87fdea3ae891563b0169c68d1c2ab (patch) | |
| tree | 583c890687beaf7f380fc0be131bdf17485f06fa /tests/sync/bootstrap.rs | |
| parent | 52489d3b1a7d79e164b4cc901b53fd06c05ce1b1 (diff) | |
fix: resolve all fmt and clippy warnings
Main lib (src/):
- Add #[allow(dead_code)] for build_info field (stored to prevent Prometheus unregistration)
- Add #[allow(dead_code)] for first_seen field (reserved for future rate limiting)
- Replace .or_insert_with(RelaySyncNeeds::default) with .or_default()
- Replace manual div_ceil implementations with .div_ceil(100)
Test code (tests/):
- Replace .expect(&format!(...)) with .unwrap_or_else(|_| panic!(...))
- Remove needless borrows in fetch_metrics() calls
- Add #[allow(dead_code)] and #[allow(unused_imports)] to test helpers module
grasp-audit:
- Apply cargo fmt to fix formatting
Diffstat (limited to 'tests/sync/bootstrap.rs')
| -rw-r--r-- | tests/sync/bootstrap.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/sync/bootstrap.rs b/tests/sync/bootstrap.rs index 8a181c9..174fe28 100644 --- a/tests/sync/bootstrap.rs +++ b/tests/sync/bootstrap.rs | |||
| @@ -167,7 +167,8 @@ async fn test_relay_replays_events_after_restart() { | |||
| 167 | .kind(Kind::Custom(KIND_REPOSITORY_STATE)) | 167 | .kind(Kind::Custom(KIND_REPOSITORY_STATE)) |
| 168 | .author(keys.public_key()); | 168 | .author(keys.public_key()); |
| 169 | 169 | ||
| 170 | let synced_first = wait_for_event_on_relay(relay_b.url(), filter.clone(), Duration::from_secs(5)).await; | 170 | let synced_first = |
| 171 | wait_for_event_on_relay(relay_b.url(), filter.clone(), Duration::from_secs(5)).await; | ||
| 171 | println!("First sync check: {}", synced_first); | 172 | println!("First sync check: {}", synced_first); |
| 172 | 173 | ||
| 173 | // 8. Stop relay_b | 174 | // 8. Stop relay_b |
| @@ -193,7 +194,8 @@ async fn test_relay_replays_events_after_restart() { | |||
| 193 | // 12. Verify announcement is available on new relay_b | 194 | // 12. Verify announcement is available on new relay_b |
| 194 | // The announcement listed the OLD relay_b domain, but since relay_a still | 195 | // The announcement listed the OLD relay_b domain, but since relay_a still |
| 195 | // has the event, new relay_b should be able to sync it via bootstrap | 196 | // has the event, new relay_b should be able to sync it via bootstrap |
| 196 | let synced_after_restart = wait_for_event_on_relay(relay_b_new.url(), filter, Duration::from_secs(5)).await; | 197 | let synced_after_restart = |
| 198 | wait_for_event_on_relay(relay_b_new.url(), filter, Duration::from_secs(5)).await; | ||
| 197 | 199 | ||
| 198 | // 13. Cleanup | 200 | // 13. Cleanup |
| 199 | relay_b_new.stop().await; | 201 | relay_b_new.stop().await; |
| @@ -384,7 +386,8 @@ async fn test_history_sync_without_negentropy() { | |||
| 384 | relay_b_port, | 386 | relay_b_port, |
| 385 | Some(relay_a.url().into()), | 387 | Some(relay_a.url().into()), |
| 386 | true, // disable_negentropy = true | 388 | true, // disable_negentropy = true |
| 387 | ).await; | 389 | ) |
| 390 | .await; | ||
| 388 | println!( | 391 | println!( |
| 389 | "relay_b started at {} (domain: {}) - negentropy DISABLED, will do HISTORY sync", | 392 | "relay_b started at {} (domain: {}) - negentropy DISABLED, will do HISTORY sync", |
| 390 | relay_b.url(), | 393 | relay_b.url(), |