diff options
| author | Jesse Vincent <jesse@fsck.com> | 2026-10-21 13:12:44 -0700 |
|---|---|---|
| committer | Jesse Vincent <jesse@fsck.com> | 2026-10-21 13:12:44 -0700 |
| commit | e8d28a06aa8d1fe7d46057ee804b1e2385e836df (patch) | |
| tree | 5e3a3c9af45c3474506fb62a3ce664bd03a2cdc4 /tests/opencode/test-plugin-loading.sh | |
| parent | c4c226fe39558c2056b08a134cbf5d103bee215d (diff) | |
test(brainstorm-server): wait for file events instead of sleeping
On macOS, fs.watch (FSEvents) delivered events anywhere from ~100ms to
2.4s after the write on Node 26.10 / Darwin 27, and sometimes held an
event back to deliver it in a batch with a later one. The file-watching
tests slept a fixed 500ms, so they failed when an event came late, and a
late event from one test could trigger a reload or clear state/events
during another. Six tests failed on v7.0.0 and on dev, a different six
each run.
The tests now poll for the outcome with a 5s timeout, wait until the
server logs the exact screen event they caused, and drain in-flight
events with a barrier file before asserting that nothing reloaded or
that state/events survived. 15 consecutive runs pass; dropping the
server's .html/dotfile filter still fails both negative tests.
Diffstat (limited to 'tests/opencode/test-plugin-loading.sh')
0 files changed, 0 insertions, 0 deletions
