tests: the shadow test waits for the verdict status to settle before asserting it
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:
parent
7420541df6
commit
539d73bc36
1 changed files with 11 additions and 1 deletions
|
|
@ -395,7 +395,17 @@ fn the_shadow_follows_the_real_service_and_catches_every_planted_difference() {
|
|||
);
|
||||
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!(
|
||||
"shadow after both processes: {}",
|
||||
serde_json::to_string_pretty(&passed).unwrap()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue