tests: the shadow test waits for the verdict status to settle before asserting it
Some checks are pending
ci / node 22 (test + typecheck) (push) Waiting to run
ci / rust stable (cargo test --workspace --release) (push) Waiting to run
ci / infra/tests/lint.sh (push) Waiting to run
ci / playwright apps/stage (allowed to fail) (push) Waiting to run

The compared count and the status are recomputed on different verdict
writes; on a loaded box the v0.7.1 release gate read the new count with
the status still 'running'. Bounded wait (120 s); assertions unchanged.
This commit is contained in:
acamilo 2026-09-30 20:57:27 +00:00
parent 7420541df6
commit 539d73bc36

View file

@ -395,7 +395,17 @@ fn the_shadow_follows_the_real_service_and_catches_every_planted_difference() {
); );
std::thread::sleep(Duration::from_millis(200)); std::thread::sleep(Duration::from_millis(200));
} }
let passed = verdict_of(&out); // The compared count and the status are recomputed on different verdict writes: a loaded box
// read the new count with the status still `running` (the v0.7.1 release gate). Wait, bounded,
// for the status to settle before asserting it.
let settle_by = Instant::now() + Duration::from_secs(120);
let passed = loop {
let v = verdict_of(&out);
if v["status"] != "running" || handle.is_finished() || Instant::now() >= settle_by {
break v;
}
std::thread::sleep(Duration::from_millis(200));
};
eprintln!( eprintln!(
"shadow after both processes: {}", "shadow after both processes: {}",
serde_json::to_string_pretty(&passed).unwrap() serde_json::to_string_pretty(&passed).unwrap()