-
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: fix flaky fs-watch tests #8115
Conversation
LGTM |
/cc @bnoordhuis |
LGTM |
`test-fs-watch-recursive` and `test-fs-watch` were both watching the same folder: `tmp/testsubdir` so running them sequentially on `OS X` could make `test-fs-watch` to fail due to events generated in the other test. Make them watch a random directory to fix the issue. Fixes: nodejs#8045
Updated so the random directory is not created twice in |
@@ -78,7 +73,9 @@ setImmediate(function() { | |||
fs.writeFileSync(filepathTwoAbs, 'pardner'); | |||
}); | |||
|
|||
fs.mkdirSync(testsubdir, 0o700); | |||
var filenameThree = 'newfile.txt'; |
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.
Can you make these const
?
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.
Sure, I was just trying to keep the modifications to a minimum. Should I use const
everywhere on the test or just in the variables I moved?
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.
I'd just update the variables you're moving. It won't change the size of the diff.
LGTM |
Done. Thanks! |
LGTM |
`test-fs-watch-recursive` and `test-fs-watch` were both watching the same folder: `tmp/testsubdir` so running them sequentially on `OS X` could make `test-fs-watch` to fail due to events generated in the other test. Make them watch a random directory to fix the issue. Fixes: #8045 PR-URL: #8115 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 5f617c5. Thank you @santigimeno ! |
`test-fs-watch-recursive` and `test-fs-watch` were both watching the same folder: `tmp/testsubdir` so running them sequentially on `OS X` could make `test-fs-watch` to fail due to events generated in the other test. Make them watch a random directory to fix the issue. Fixes: #8045 PR-URL: #8115 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Description of change
test-fs-watch-recursive
andtest-fs-watch
were both watching thesame folder:
tmp/testsubdir
so running them sequentially onOS X
could make
test-fs-watch
to fail due to events generated in the othertest. Make them watch a random directory to fix the issue.
Fixes: #8045