From 545a8848a97b77899c96a8047f98d7e2f1931dab Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 6 Nov 2026 05:33:59 +0100 Subject: bench waits for recorded links --- src/simtest/bench.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/simtest/bench.rs') diff --git a/src/simtest/bench.rs b/src/simtest/bench.rs index d8c08e2..2a96007 100644 --- a/src/simtest/bench.rs +++ b/src/simtest/bench.rs @@ -502,6 +502,23 @@ async fn run(seed: u64, scenario: &'static Scenario) -> String { ) .await; sim.wait_converged(all, SETTLE).await; + // The links that don't work recorded (`swarm::working_links`, after their hold), so + // the trees are built over the links that do from the first write: every node + // checked since, with nothing awaiting its hold. Lossy links may keep some waiting: + // not for longer than settling. + let checks: Vec = all + .iter() + .map(|node| crate::swarm::working_links::settled(node).0) + .collect(); + let recording = Instant::now(); + while recording.elapsed() < SETTLE + && !all.iter().zip(&checks).all(|(node, before)| { + let (checks, settled) = crate::swarm::working_links::settled(node); + checks > *before && settled + }) + { + tokio::time::sleep(Duration::from_secs(1)).await; + } // Neighbours chosen, handshakes done, what joining set off over: sync messages no // fewer in a half of the quiet phase than in the one before (some go on for good: // alive stamps, registrations). Those two halves are the quiet phase. -- cgit v1.3.1