Skip to content

test: fix flaky test-fs-watchfile on macOS

Rodrigo Muino Tomonari requested to merge github/fork/Trott/watch-race into master

On macOS, a watcher created with fs.watch() does not necessarily start receiving events immediately. So it can miss a change by fs.writefile() if it comes very soon after the watcher is created. Fix test flakiness caused by this by using setInterval() to repeat the write action.

Fixes: https://github.com/nodejs/node/issues/13248

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test fs

Merge request reports

Loading