<!-- Thank you for reporting an issue. This issue tracker is for bugs and issues found within Node.js core. If you require more general support please file an issue on our help repo. https://github.com/nodejs/help Please fill in as much of the template below as you're able. Version: output of `node -v` Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows) Subsystem: if known, please specify affected core module name If possible, please provide code that demonstrates the problem, keeping it as simple and free of external dependencies as you are able. --> * **Version**: 11.0.0-pre (master) * **Platform**: win10 vs2017 * **Subsystem**: test <!-- Enter your issue details below this comment. --> https://ci.nodejs.org/job/node-test-binary-windows/18408/COMPILED_BY=vs2017,RUNNER=win10,RUN_SUBSET=3/console ```console 13:48:22 not ok 561 sequential/test-fs-watch-file-enoent-after-deletion 13:48:22 --- 13:48:22 duration_ms: 0.668 13:48:22 severity: fail 13:48:22 exitcode: 1 13:48:22 stack: |- 13:48:22 assert.js:80 13:48:22 throw new AssertionError(obj); 13:48:22 ^ 13:48:22 13:48:22 AssertionError [ERR_ASSERTION]: Input A expected to strictly equal input B: 13:48:22 + expected - actual 13:48:22 13:48:22 - 0 13:48:22 + 1 13:48:22 at StatWatcher.<anonymous> (c:\workspace\node-test-binary-windows\test\sequential\test-fs-watch-file-enoent-after-deletion.js:46:10) 13:48:22 at StatWatcher.<anonymous> (c:\workspace\node-test-binary-windows\test\common\index.js:467:15) 13:48:22 at StatWatcher.emit (events.js:182:13) 13:48:22 at StatWatcher.onchange (internal/fs/watchers.js:47:8) 13:48:22 ... ```
Activity
Trott commentedon Jul 6, 2018
Looks to be a race condition between
watchFile()andsetTimeout().Trott commentedon Jul 6, 2018
Reproducible if you put the call to
watchFile()in a timer such that it gets executed aftersetTimeout().Trott commentedon Jul 6, 2018
(
fs.watchfile()is synchronous, but probably the underlying operating system watch stuff it depends on is not?)Trott commentedon Jul 6, 2018
@nodejs/platform-windows @nodejs/fs @nodejs/testing
Trott commentedon Jul 6, 2018
This has, unsurprisingly, come up before:
f1c890afb05
#13800 especially #13800 (comment)
#14010
Trott commentedon Jul 6, 2018
OK, now I think I have a fix...
Trott commentedon Jul 6, 2018
Hopeful fix: #21694
test: fix flaky watchFile()
test: fix flaky watchFile()