-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: delay unlink in test-regress-GH-4027.js #14010
Conversation
The sequential/test-regress-GH-4027 test is flaky with an increased system load, failing when the watched file is unlinked before the first state of the watched file is retrieved. After increasing the delay before unlinking and calling setTimeout after watchFile, the flakiness stopped reproducing. Fixes: nodejs#13800
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if CI is green
I confirmed that changing the test this way (and making a few other modifications so as to run in Node.js 0.8) results in a test that fails (as expected) in 0.8.9 and passes in 0.8.10 (where the bug was fixed). So that's good.
I'd prefer something that eliminates the race condition rather than accommodates it, but that may not be possible. And if it is possible, someone can do it in a subsequent PR.
|
||
fs.watchFile(filename, { interval: 50 }, common.mustCall(function(curr, prev) { | ||
assert.strictEqual(prev.nlink, 1); | ||
assert.strictEqual(curr.nlink, 0); | ||
fs.unwatchFile(filename); | ||
})); | ||
|
||
setTimeout(fs.unlinkSync, 300, filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
common.platformTimeout?
Asking for context: AFAICT the test needs to |
@refack I'm not sure I understand your question, but I think this is what's going on so maybe this helps?: |
(In other words, I don't think the |
AFAICT the original bug would happen if |
@refack From my understanding, the test is a regression test that is there to verify that there isn't a regression in this issue nodejs/node-v0.x-archive#4027 which is fixed in nodejs/node-v0.x-archive@39a0836, which landed in https://github.com/nodejs/node-v0.x-archive/tree/v0.8.10-release . So, @Trott ran the test in |
@jaimecbernardo I think @refack groks all that. He's asking about the original bug and requirements for triggering it. I didn't look closely at it, just empirically tested to see that the test still functions as expected. So I don't have an answer for him. But that shouldn't stop this from landing. He's looking for a deep dive into the original bug, not how the test works. (And he'll correct me if I'm wrong about any of this! :-D ) |
Landed in f1c890a. Thanks for the contribution! 🎉 |
The sequential/test-regress-GH-4027 test is flaky with an increased system load, failing when the watched file is unlinked before the first state of the watched file is retrieved. After increasing the delay before unlinking and calling setTimeout after watchFile, the flakiness stopped reproducing. PR-URL: #14010 Fixes: #13800 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The sequential/test-regress-GH-4027 test is flaky with an increased system load, failing when the watched file is unlinked before the first state of the watched file is retrieved. After increasing the delay before unlinking and calling setTimeout after watchFile, the flakiness stopped reproducing. PR-URL: #14010 Fixes: #13800 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The sequential/test-regress-GH-4027 test is flaky with an increased system load, failing when the watched file is unlinked before the first state of the watched file is retrieved. After increasing the delay before unlinking and calling setTimeout after watchFile, the flakiness stopped reproducing. PR-URL: #14010 Fixes: #13800 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The sequential/test-regress-GH-4027 test is flaky with an increased system load, failing when the watched file is unlinked before the first state of the watched file is retrieved. After increasing the delay before unlinking and calling setTimeout after watchFile, the flakiness stopped reproducing. PR-URL: #14010 Fixes: #13800 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The sequential/test-regress-GH-4027 test is flaky with an increased system load, failing when the watched file is unlinked before the first state of the watched file is retrieved. After increasing the delay before unlinking and calling setTimeout after watchFile, the flakiness stopped reproducing. PR-URL: #14010 Fixes: #13800 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The sequential/test-regress-GH-4027 test is flaky with an increased system load, failing when the watched file is unlinked before the first state of the watched file is retrieved. After increasing the delay before unlinking and calling setTimeout after watchFile, the flakiness stopped reproducing. PR-URL: #14010 Fixes: #13800 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The sequential/test-regress-GH-4027 test is flaky with an increased system load, failing when the watched file is unlinked before the first state of the watched file is retrieved. After increasing the delay before unlinking and calling setTimeout after watchFile, the flakiness stopped reproducing. PR-URL: #14010 Fixes: #13800 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The sequential/test-regress-GH-4027 test is flaky on Windows CI with an increased system load, failing when the watched file is unlinked before the first state of the watched file is retrieved.
After increasing the delay before unlinking and calling
setTimeout
afterwatchFile
, the flakiness stopped reproducing.Fixes: #13800
/cc @nodejs/testing
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test