aboutsummaryrefslogtreecommitdiffstats
path: root/src/simtest
diff options
context:
space:
mode:
Diffstat (limited to 'src/simtest')
-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);
}
}