From 10a1863cc76af8afced37478eca4c6022fcf3dbc Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sat, 1 Aug 2026 00:15:54 +0200 Subject: [PATCH] test(host/audio): give the reopen tests longer than the backoff they wait for MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `wait_until` allowed 200 × 10 ms — exactly the 2 s `backoff_start` the reopen path spends before it can succeed. On a warm, idle machine it wins the race; on a cold binary or a loaded box it does not, and `reopens_after_push_death` failed 3 of ~5 cold runs while gating this branch. CI is always cold. Six seconds costs nothing when the test passes and only delays a genuine failure, so the budget now clears the backoff with room to spare. Co-Authored-By: Claude Fable 5 --- crates/punktfunk-host/src/audio/mic_pump.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/punktfunk-host/src/audio/mic_pump.rs b/crates/punktfunk-host/src/audio/mic_pump.rs index 912ddf45..030e4659 100644 --- a/crates/punktfunk-host/src/audio/mic_pump.rs +++ b/crates/punktfunk-host/src/audio/mic_pump.rs @@ -496,8 +496,11 @@ mod pump_tests { start_tuned(fail_first, false, Duration::ZERO) } + /// The budget has to clear `backoff_start` (2 s) with room to spare: a reopen test that + /// waits exactly as long as the backoff it is waiting for fails whenever the machine is + /// busy or the binary is cold, which is precisely what CI is. fn wait_until(what: &str, mut cond: impl FnMut() -> bool) { - for _ in 0..200 { + for _ in 0..600 { if cond() { return; }