aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-08 13:33:34 +0000
committertv <tv@krebsco.de>2026-11-08 14:42:18 +0100
commit46e6b42278db1a3f51d1f5e1fe887f74ed2b69db (patch)
tree3df80180d9d68a5c3f5ac8369b458662f8f95e0b
parentd015ec9500fbb6b0e54977e1c5ea616483e06d68 (diff)
simtest: the forged write refused by whichever node judges it first
a_swarm_judging_every_change waited for c's forged write to be refused by a, b and d each. The first to judge it tells c, which drops it before the others may have it: wait for a refusal on any of them, then for c to drop it.
-rw-r--r--src/simtest/policy.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/simtest/policy.rs b/src/simtest/policy.rs
index 0453c54..4873b38 100644
--- a/src/simtest/policy.rs
+++ b/src/simtest/policy.rs
@@ -114,11 +114,16 @@ async fn a_swarm_judging_every_change() {
// A write c lets through for a user the registry doesn't have: refused by the
// others, and so is what c builds on it.
forge(&c, "mallory", "notes/forged", json!(4)).await;
+ // By whichever node judges it first: c, told, drops it before the others may.
+ sim.wait_until("the forged write is refused", SOON, || async {
+ refused(&a).await + refused(&b).await + refused(&d).await > 0
+ })
+ .await;
+ sim.wait_until("c drops it", SOON, || async {
+ !holds(&c, "notes/forged").await
+ })
+ .await;
for node in [&a, &b, &d] {
- sim.wait_until("the forged write is refused", SOON, move || async move {
- refused(node).await > 0
- })
- .await;
assert!(!holds(node, "notes/forged").await);
}
}