diff options
| author | tv <tv@krebsco.de> | 2026-11-08 13:33:34 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-08 14:42:18 +0100 |
| commit | 46e6b42278db1a3f51d1f5e1fe887f74ed2b69db (patch) | |
| tree | 3df80180d9d68a5c3f5ac8369b458662f8f95e0b /src/simtest | |
| parent | d015ec9500fbb6b0e54977e1c5ea616483e06d68 (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.
Diffstat (limited to 'src/simtest')
| -rw-r--r-- | src/simtest/policy.rs | 13 |
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); } } |
