fix(daemon): fix flaky file-watcher workflow test on macOS #175
Reference in New Issue
Block a user
Delete Branch "fix/149-flaky-file-watcher"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Un-skip and fix the flaky test "does NOT emit workflow change for nerve.yaml".
Why
macOS fs.watch coalesces events — the workflow file created during setup was leaking events into the nerve.yaml test window, causing false failures (#149).
Changes
file-watcher-workflow.test.ts— use a temp dir with NO workflow files for the negative test, eliminating the event coalescing source. Increased settle time to 200ms.Ref
Fixes #149
根因分析精准,修法干净。用无 workflow 文件的临时目录从源头消除事件合并问题,settle 时间也合理调大。
小建议:dir 清理可考虑放 afterEach/finally 防 waitFor 超时跳过,不过临时目录影响不大。LGTM ✅