Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit be16cc9

Browse filesBrowse files
Trottaddaleax
authored andcommitted
test: set umask for tests
#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>
1 parent 3bebcf0 commit be16cc9
Copy full SHA for be16cc9

File tree

Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Open diff view settings
Collapse file

‎test/common/index.js‎

Copy file name to clipboardExpand all lines: test/common/index.js
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ 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+
//
40+
// process.umask() is not available in workers so we need to check for its
41+
// existence.
42+
if (process.umask)
43+
process.umask(0o022);
44+
3745
const noop = () => {};
3846

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.