Skip to content

Commit c3c94c0

Browse files
committed
test: set umask for tests
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.
1 parent 284b20b commit c3c94c0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/common/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ const {
3434
hasIntl
3535
} = process.binding('config');
3636

37+
// Some tests assume a umask of 0o022 so set that up front. Tests that need a
38+
// different umask will set it themselves.
39+
process.umask(0o022);
40+
3741
const noop = () => {};
3842

3943
const hasCrypto = Boolean(process.versions.openssl);

0 commit comments

Comments
 (0)