Skip to content

fix: time the pacing pause from inside it, so a slow runner cannot fail the recovery test - #54

Merged
itz4blitz merged 1 commit into
mainfrom
fix/flaky-pacing-test
Oct 20, 2026
Merged

itz4blitz merged 1 commit into
mainfrom
fix/flaky-pacing-test

Conversation

@itz4blitz

Copy link
Copy Markdown
Owner

adapters::tests::recovery_hints_do_not_bypass_http_or_command_pacing failed on macOS CI for #53, which changes nothing in chatd (run):

assertion failed: finished.recv_timeout(Duration::from_millis(50)).is_err()

The test started a 150 ms pause, sent a recovery hint, then required that the pause not finish within the next 50 ms. That window began at the hint, not at the pause's start. If the main thread stalls for about 100 ms after spawning, which happens on a loaded runner, the pause finishes on time inside the window and the test fails. pause itself is correct: wait_timeout_while only returns early on stop.

Now the spawned thread times its own pause and the test asserts it lasted at least 150 ms. Delays in scheduling can only lengthen that, so it no longer flakes.

Validation: cargo test -p chatd --lib recovery passed 3 of 3, and 5 repeated runs of the changed test passed.

🤖 Generated with Claude Code

…il the recovery test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@itz4blitz
itz4blitz merged commit 2b8fc53 into main Oct 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant