You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test-fs-watchfile failure on OSX - intermittent ? #13248
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 sequential so it is not competing for resources with other tests.
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
@refack you had mentioned that having common.refreshTmpDir() in there could cause the test to fail on Windows. Is there anyway to avoid that?
Edit: After a quick test, it appears that this is still reproducible even after adding common.refreshTmpDir(). Still could be related to my changes though.
My recollection is that (on macOS at least) you are not guaranteed to start receiving events write after fs.watch() returns.
Wrapping the fs.writeFile() in a setTimeout() for 100ms makes the test reliable on my machine. I'm going to test more, but if it holds up, I'll experiment a bit more with process.nextTick(), setImmediate(), etc. before opening a PR.
Activity
mhdawson commentedon May 26, 2017
stress run of 200 https://ci.nodejs.org/job/node-stress-single-test/1234/
Trott commentedon May 26, 2017
I can replicate this locally with this command:
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
sequentialso it is not competing for resources with other tests.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
refack commentedon May 26, 2017
Maybe #13111
refack commentedon May 26, 2017
Probably my fault, I said it would work without
common.refreshTmpDir()refack commentedon May 27, 2017
Have a PR borrowing
chris--young commentedon May 27, 2017
@refack you had mentioned that having
common.refreshTmpDir()in there could cause the test to fail on Windows. Is there anyway to avoid that?Edit: After a quick test, it appears that this is still reproducible even after adding
common.refreshTmpDir(). Still could be related to my changes though.refack commentedon May 27, 2017
Yeah, make sure that you
rmdirbefore.Did it in #13251
Trott commentedon May 27, 2017
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:
My recollection is that (on macOS at least) you are not guaranteed to start receiving events write after
fs.watch()returns.Wrapping the
fs.writeFile()in asetTimeout()for 100ms makes the test reliable on my machine. I'm going to test more, but if it holds up, I'll experiment a bit more withprocess.nextTick(),setImmediate(), etc. before opening a PR.test: fix flaky test-fs-watchfile on macOS
Trott commentedon May 27, 2017
Proposed fix in #13252
test: fix flaky test-fs-watchfile on macOS
test: fix flaky test-fs-watchfile on macOS
test,fs: test fs.watch for `filename`
test,fs: test fs.watch for `filename`