aboutsummaryrefslogtreecommitdiffstats
path: root/src/simtest
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-03 05:36:16 +0100
committertv <tv@krebsco.de>2026-11-03 05:36:16 +0100
commit7d3af05498c770d188d7d21c52974e33d9df3b9f (patch)
treeb47ecf9fcf2e87d32603975c91780fdc4541a074 /src/simtest
parent8366f7c5de474753dbfbf88431917e79c15e5389 (diff)
order members by distance
Diffstat (limited to 'src/simtest')
-rw-r--r--src/simtest/reach.rs15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/simtest/reach.rs b/src/simtest/reach.rs
index 2c188cf..20f770c 100644
--- a/src/simtest/reach.rs
+++ b/src/simtest/reach.rs
@@ -53,9 +53,8 @@ async fn neighbours_tell_whom_they_reach() {
}
/// The same three: in x's tree (`swarm::tree`), c can't take x as its parent (it
-/// doesn't reach it), so it takes b, which comes before it if c comes later by pair
-/// key; else c has no parent and gets x's changes from announcements. Either way x's
-/// only child is b, and nobody but b passes x's changes to c.
+/// doesn't reach it), so it takes b, which comes before it: as far from x, but it
+/// reaches x. So x's only child is b, and b's is c.
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
async fn writer_trees_go_around_links_down() {
let sim = Sim::with_identity(67);
@@ -71,21 +70,15 @@ async fn writer_trees_go_around_links_down() {
sim.wait_ready(&[&b, &c, &x], SOON).await;
let (b, c, x) = (&b, &c, &x);
let writer = topology::pair_key(x.local_id());
- let c_after_b = topology::pair_key(c.local_id()) > topology::pair_key(b.local_id());
sim.wait_until(
- "x's tree: b under x, and c under b if c comes after it",
+ "x's tree: b under x, and c under b",
SOON,
move || async move {
let of_x = tree::children(x, writer).await;
let of_b = tree::children(b, writer).await;
heard(c, b, x).await
&& of_x == [b.local_id().to_owned()]
- && of_b
- == if c_after_b {
- vec![c.local_id().to_owned()]
- } else {
- Vec::new()
- }
+ && of_b == [c.local_id().to_owned()]
},
)
.await;