From e4d1a4494f6978cd14588ed938768410d815b387 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 9 Oct 2026 00:17:53 -0400 Subject: [PATCH] G3: audio scrub test waits on the clock, not a step count (flaky under load) Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/tests/ui_audio_scrub.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/tests/ui_audio_scrub.rs b/crates/ui-egui/tests/ui_audio_scrub.rs index a2d86b79d..01843de78 100644 --- a/crates/ui-egui/tests/ui_audio_scrub.rs +++ b/crates/ui-egui/tests/ui_audio_scrub.rs @@ -132,7 +132,10 @@ fn preview_with_audio_shows_every_frame_and_sounds_once_cached() { assert!(h.state().playback.audio_held && h.state().audio.is_none(), "nothing is cached: no sound yet"); let mut last = frame(&h); let mut shown = 0; - for _ in 0..2000 { + // Wait on the clock, not a step count: under a loaded machine (parallel test binaries) the + // background cache can take far longer than 2000 short steps to get ahead. + let deadline = std::time::Instant::now() + std::time::Duration::from_secs(60); + while std::time::Instant::now() < deadline { h.step(); if h.state().audio.is_some() { break;