-
Notifications
You must be signed in to change notification settings - Fork 30k
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: set umask explicitly #25213
test: set umask explicitly #25213
Conversation
Some tests which create files and check file permissions assume the umask is compatible with 022, and break when set to something like 007. Explicitly set umask to 022
The issue here is that the temp directory is being created with more restrictive permissions than that being used by the test. Rather than fixing in the Python test runner, might it be better to change the
Counterarguments I can think of would be that this solution is simpler, and there may be edge cases where it's more robust too although I can't think of any. |
Sorry, I didn't list all failing tests. Here are the rest:
so this isn't purely a tmpdir issue I would consider the umask part of the test environment that the test framework should sanitize before each run, just like with environment variables. A common entry point to all test would be the best place to set it, if the Python test runner is not such a place If there are tests that should be run with a different umask, I think they should be separate tests where we explicitly override the default, so a single test run covers all cases |
All of the listed failures are indeed the same tmpdir issue (which makes sense because tests generally shouldn't be creating files outside of tmpdir).
That all makes a lot of sense to me. Perhaps both things should be done. |
Belated welcome @i8-pi and thanks for the pull request! As you might guess, reviews can be a bit slow to happen this time of year, even for simple changes, so thanks in advance for your patience. |
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.
Thanks @i8-pi, LGTM. CI: https://ci.nodejs.org/job/node-test-pull-request/19853/
Windows re-build: https://ci.nodejs.org/job/node-test-commit-windows-fanned/23668/ |
Landed in ee592c3 |
Some tests which create files and check file permissions assume the umask is compatible with 022, and break when set to something like 007. Explicitly set umask to 022 PR-URL: #25213 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Some tests which create files and check file permissions assume the umask is compatible with 022, and break when set to something like 007. Explicitly set umask to 022 PR-URL: #25213 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
nodejs#25213 proposes setting umask in the Python test runner to avoid spurious test failures when running from a shell with a restrictive umask. This is a good idea, but will only fix the issue for tests run with the Python runner. Set it in `common/index.js` as well so that it fixes it even when tests are run directly with a `node` binary, bypassing the Python test runner.
nodejs#25213 proposes setting umask in the Python test runner to avoid spurious test failures when running from a shell with a restrictive umask. This is a good idea, but will only fix the issue for tests run with the Python runner. Set it in `common/index.js` as well so that it fixes it even when tests are run directly with a `node` binary, bypassing the Python test runner. PR-URL: nodejs#25229 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Some tests which create files and check file permissions assume the umask is compatible with 022, and break when set to something like 007. Explicitly set umask to 022 PR-URL: nodejs#25213 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
#25213 proposes setting umask in the Python test runner to avoid spurious test failures when running from a shell with a restrictive umask. This is a good idea, but will only fix the issue for tests run with the Python runner. Set it in `common/index.js` as well so that it fixes it even when tests are run directly with a `node` binary, bypassing the Python test runner. PR-URL: #25229 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Some tests which create files and check file permissions assume the umask is compatible with 022, and break when set to something like 007. Explicitly set umask to 022 PR-URL: nodejs#25213 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
nodejs#25213 proposes setting umask in the Python test runner to avoid spurious test failures when running from a shell with a restrictive umask. This is a good idea, but will only fix the issue for tests run with the Python runner. Set it in `common/index.js` as well so that it fixes it even when tests are run directly with a `node` binary, bypassing the Python test runner. PR-URL: nodejs#25229 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Some tests which create files and check file permissions assume the umask is compatible with 022, and break when set to something like 007. Explicitly set umask to 022 PR-URL: #25213 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Some tests which create files and check file permissions assume the umask is compatible with 022, and break when set to something like 007. Explicitly set umask to 022 PR-URL: #25213 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Some tests which create files and check file permissions assume the umask is compatible with 022, and break when set to something like 007. Explicitly set umask to 022 PR-URL: #25213 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Some tests which create files and check file permissions assume the
umask is compatible with 022, and break when set to something like 007.
Explicitly set umask to 022
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesI'm seeing test errors
when running
umask 007; make -j4 test