Skip to content

test: give the watcher tests a debounce a slow runner cannot outrun - #28

Merged
hidekingerz merged 1 commit into
mainfrom
claude/watch-test-flake
Sep 6, 2026
Merged

test: give the watcher tests a debounce a slow runner cannot outrun#28
hidekingerz merged 1 commit into
mainfrom
claude/watch-test-flake

Conversation

@hidekingerz

@hidekingerz hidekingerz commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

TestCoalescesBurst failed 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/watch passes
  • gofmt -l ., go vet ./... clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01KUYF9hXeZFML1s8r3i2RVX

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
hidekingerz force-pushed the claude/watch-test-flake branch from 6e337e4 to e2773e0 Compare September 6, 2026 07:35
@hidekingerz hidekingerz changed the title test: skip the burst-coalescing assertion when the writes outlast the debounce test: give the watcher tests a debounce a slow runner cannot outrun Sep 6, 2026
@hidekingerz
hidekingerz merged commit aac0504 into main Sep 6, 2026
3 checks passed
@hidekingerz
hidekingerz deleted the claude/watch-test-flake branch September 6, 2026 07:38
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