test: give the watcher tests a debounce a slow runner cannot outrun - #28
Merged
Conversation
TestCoalescesBurst failed once in CI: 20 writes took longer than the 20 ms test debounce on a shared runner under the race detector, the watcher correctly reported twice, and the test called that a failure. Locally the writes take under 3 ms. The test debounce is now 100 ms, closer to the 200 ms the program uses, so a burst lands inside one window with room to spare; the quiet period grows to match. The watcher itself is unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KUYF9hXeZFML1s8r3i2RVX
hidekingerz
force-pushed
the
claude/watch-test-flake
branch
from
September 6, 2026 07:35
6e337e4 to
e2773e0
Compare
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TestCoalescesBurstfailed once in CI (run 34018801238, on #27 which only touched go.mod) with "burst should report once: unexpected event". The test writes a file 20 times and asserts one report, which holds only if the writes land inside the 20 ms test debounce. On a shared runner under the race detector they took longer, the watcher correctly reported twice, and the test called that a failure. Locally the 20 writes take under 3 ms (worst of 200 runs).The test debounce is now 100 ms, closer to the 200 ms the program uses, and the quiet period 500 ms to match. The watcher itself is unchanged; the package's tests take about two seconds instead of one.
Test plan
TMPDIR=/tmp go test -race -count=20 -cpu=1 ./internal/watchpassesgofmt -l .,go vet ./...clean🤖 Generated with Claude Code
https://claude.ai/code/session_01KUYF9hXeZFML1s8r3i2RVX