-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: make test-fs-watch-recursive more robust #9228
Conversation
The test was failing on OS X when run in parallel with: ``` tools/test.py --repeat=99 -J parallel/test-fs-watch-recursive ``` ENOENT was arising when trying to create a file in the directory created with `fs.mkdtempSync()`. I do not know if this is a bug in OS X, a bug in libuv, or something else. I also do not know this is partially or completely the cause of the flakiness of the test in CI and locally (when run as part of `make test`). In any event, changing to `fs.mkdirSync()` resolved the issue.
59c6b10
to
199d650
Compare
@santigimeno has done some looking into this and it looks like this fix is misguided. I've added the |
I can get the error even with a
which yields things like:
It also very occasionally gives me |
Seems to have to do with the interaction of the
But this seemingly equivalent command succeeds every time:
/cc @nodejs/testing or maybe @nodejs/build or maybe someone whose Python-knowledgable which I think might be @thefourtheye |
Figured it out. Closing this. PR addressing |
The repeat option in test.py did not work as expected if `-j` was set to more than one. Repeated tests running at the same time could share temp directories and cause test failures. This was observed with: tools/test.py -J --repeat=10 parallel/test-fs-watch-recursive By using copy.deepCopy(), the repeated tests are separate objects and not references to the same objects. Setting `thread_id` on one of them will now not change the `thread_id` on all of them. And `thread_id` is how the temp directory (and common.PORT as well) are determined. Refs: nodejs#9228
The repeat option in test.py did not work as expected if `-j` was set to more than one. Repeated tests running at the same time could share temp directories and cause test failures. This was observed with: tools/test.py -J --repeat=10 parallel/test-fs-watch-recursive By using copy.deepCopy(), the repeated tests are separate objects and not references to the same objects. Setting `thread_id` on one of them will now not change the `thread_id` on all of them. And `thread_id` is how the temp directory (and common.PORT as well) are determined. Refs: #9228 PR-URL: #9249 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
The repeat option in test.py did not work as expected if `-j` was set to more than one. Repeated tests running at the same time could share temp directories and cause test failures. This was observed with: tools/test.py -J --repeat=10 parallel/test-fs-watch-recursive By using copy.deepCopy(), the repeated tests are separate objects and not references to the same objects. Setting `thread_id` on one of them will now not change the `thread_id` on all of them. And `thread_id` is how the temp directory (and common.PORT as well) are determined. Refs: #9228 PR-URL: #9249 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
The repeat option in test.py did not work as expected if `-j` was set to more than one. Repeated tests running at the same time could share temp directories and cause test failures. This was observed with: tools/test.py -J --repeat=10 parallel/test-fs-watch-recursive By using copy.deepCopy(), the repeated tests are separate objects and not references to the same objects. Setting `thread_id` on one of them will now not change the `thread_id` on all of them. And `thread_id` is how the temp directory (and common.PORT as well) are determined. Refs: #9228 PR-URL: #9249 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
The repeat option in test.py did not work as expected if `-j` was set to more than one. Repeated tests running at the same time could share temp directories and cause test failures. This was observed with: tools/test.py -J --repeat=10 parallel/test-fs-watch-recursive By using copy.deepCopy(), the repeated tests are separate objects and not references to the same objects. Setting `thread_id` on one of them will now not change the `thread_id` on all of them. And `thread_id` is how the temp directory (and common.PORT as well) are determined. Refs: #9228 PR-URL: #9249 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test fs
Description of change
The test was failing on OS X when run in parallel with:
ENOENT was arising when trying to create a file in the directory created
with
fs.mkdtempSync()
. I do not know if this is a bug in OS X, a bugin libuv, or something else. I also do not know this is partially or
completely the cause of the flakiness of the test in CI and locally
(when run as part of
make test
).In any event, changing to
fs.mkdirSync()
resolved the issue./cc @nodejs/testing