fix(daemon): fix flaky file-watcher workflow test on macOS #175

Merged
xiaomo merged 1 commits from fix/149-flaky-file-watcher into main 2026-04-27 07:27:16 +00:00
Owner

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

## 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
xiaoju added 1 commit 2026-04-27 07:24:53 +00:00
Use a temp dir without workflow files for the negative test case,
avoiding macOS fs.watch event coalescing from setup file creation.

Fixes #149
xiaomo approved these changes 2026-04-27 07:27:15 +00:00
xiaomo left a comment
Owner

根因分析精准,修法干净。用无 workflow 文件的临时目录从源头消除事件合并问题,settle 时间也合理调大。

小建议:dir 清理可考虑放 afterEach/finally 防 waitFor 超时跳过,不过临时目录影响不大。LGTM

根因分析精准,修法干净。用无 workflow 文件的临时目录从源头消除事件合并问题,settle 时间也合理调大。 小建议:dir 清理可考虑放 afterEach/finally 防 waitFor 超时跳过,不过临时目录影响不大。LGTM ✅
xiaomo merged commit d555eb4bae into main 2026-04-27 07:27:16 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
2 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#175