-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test-fs-watchfile failure on OSX - intermittent ? #13248
Comments
stress run of 200 https://ci.nodejs.org/job/node-stress-single-test/1234/ |
I can replicate this locally with this command: tools/test.py --repeat 100 -j 64 test/parallel/test-fs-watchfile.js It doesn't trigger failures every time, but often enough that I haven't had to run it more than 5 times to get a failure yet. This suggests that the issue is triggered by high load. Simple solution could be to move the test to One curiosity: When it times out with the above command line, it is always starting after the 36th or 37th successful run. Not sure what that means. But maybe someone more macOS savvy would. @nodejs/platform-macos |
Maybe #13111 |
Probably my fault, I said it would work without |
Have a PR borrowing |
@refack you had mentioned that having Edit: After a quick test, it appears that this is still reproducible even after adding |
Yeah, make sure that you |
I could be wrong, but I don't think removing files plays a part here. I think the issue is that (on macOS at least) this is a race condition: fs.watch(dir, common.mustCall(function(eventType, filename) {
this._handle.close();
assert.strictEqual(filename, 'foo.txt');
}));
fs.writeFile(`${dir}/foo.txt`, 'foo', common.mustCall(function(err) {
if (err) assert.fail(err);
})); My recollection is that (on macOS at least) you are not guaranteed to start receiving events write after Wrapping the |
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: nodejs#13248
Proposed fix in #13252 |
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. PR-URL: #13252 Fixes: #13248 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#13411 Refs: nodejs#13385 Refs: nodejs#13248 Refs: nodejs#13377 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #13411 Refs: #13385 Refs: #13248 Refs: #13377 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Failure in CI testing PR with changes unrelated to fs watch
https://ci.nodejs.org/job/node-test-commit-osx/10086/nodes=osx1010/console
The text was updated successfully, but these errors were encountered: