Files
codegraph/__tests__
Colby MchenryandClaude Opus 5.5 85dd8b2a15 test(watcher): wait for a live FSEvents stream before the #770 restart edit (#2104)
The symlink retarget/restart test flaked inside the full suite with
"waitFor timed out". A traced failing run showed the edit made right after
unwatch()+watch() was never reported: fs.watch() returns before macOS
registers the stream (libuv serves a process's watches from one FSEvents
stream, rebuilt on its own thread after each watch/close), and an edit made
in that gap is dropped, not delayed — so no timeout would have helped.

Poke a probe file under the link until the watcher reports it, then make the
edit under test once. Applied after the restart (the observed failure) and
after the retarget (the same race with a 100-300ms gap). Under a simulated
300ms registration delay the old test fails 3/3 and the new one passes 3/3;
a dead post-restart stream still fails it.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 18:28:40 +00:00
..