Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.4k
test, fs: fix chmod mask testing on windows#12835
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
refack commented May 4, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
vsemozhetbyt commented May 4, 2017
Refs: #12803 |
test/parallel/test-fs-chmod.js Outdated
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.
Is this added because the files being operated on are in the fixtures dir? IMO, the test should be refactored to use the tmp dir instead so that we don't need to do this. Tests shouldn't modify files in fixtures. Then it can check mode on file creation too, I suppose.
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.
Yes. Good idea!
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.
If I copy the files to common.tmpDir it doesn't repro
refack commented May 4, 2017
/cc @nodejs/fs |
vsemozhetbyt commented May 4, 2017
refack commented May 4, 2017
vsemozhetbyt commented May 4, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
refack commented May 5, 2017
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.
Obsolete)
vsemozhetbyt commented May 5, 2017
See about |
vsemozhetbytMay 5, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
This is not necessary if known_issues.status is properly updated, if I get this right.
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'll need to set it to be excluded for every platform but windows.
This way seems less noisy...
test/parallel/test-fs-chmod.js Outdated
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.
/bin/sh: copy: command not found in Linux CI.
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.
fixed
refack commented May 5, 2017
refack commented May 5, 2017
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.
Linter:
11:22 error Strings must use singlequote quotes 11:55 error Missing semicolon semitest/parallel/test-fs-chmod.js Outdated
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.
Linter: 78:25 error Strings must use singlequote quotes
test/parallel/test-fs-chmod.js Outdated
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.
Linter: 79:25 error Strings must use singlequote quotes
test/parallel/test-fs-chmod.js Outdated
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.
Linter: 81:23 error Missing semicolon semi
refack commented May 5, 2017
@vsemozhetbyt de-linted. P.S. how do you run the lint locally, I couldn't find a good command? |
sam-github commented May 5, 2017
@refack |
refack commented May 5, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
works so bad on Windows 😭 |
vsemozhetbyt commented May 5, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@refack node tools/eslint/bin/eslint.js --rulesdir tools/eslint-rules/ --ext=.js,.md benchmark doc lib test toolsor just: eslint --rulesdir tools/eslint-rules/ --ext=.js,.md benchmark doc lib test toolsFor a file: eslint --rulesdir tools/eslint-rules/ path/to/a/file.jseslint --rulesdir tools/eslint-rules/ path/to/a/file.md |
refack commented May 5, 2017
refack commented May 5, 2017
@nodejs/platform-macos if this a real bug? Snippet from test (last line is 94)constfile1=path.join(common.tmpDir,Date.now()+'duck.js');constfile2=path.join(common.tmpDir,Date.now()+'goose.js');fs.writeFileSync(file1,'ga ga');fs.writeFileSync(file2,'waq waq');// to flush some buffersconsole.log('written');console.log('written some more');if(common.isWindows){execSync(`attrib -a -h -i -r -s ${file1}`);execSync(`attrib -a -h -i -r -s ${file2}`);}else{execSync(`touch ${file1}`);execSync(`touch ${file2}`);}fs.chmod(file1,mode_async.toString(8),common.mustCall((err)=>{assert.ifError(err);console.log(fs.statSync(file1).mode);Output |
refack commented May 13, 2017
refack commented May 13, 2017
Failing on freeBSD: https://ci.nodejs.org/job/node-stress-single-test/1213/nodes=freebsd10-64/ |
refack commented May 13, 2017
Try to fail on macOS: https://ci.nodejs.org/job/node-stress-single-test/1215/nodes=osx1010/ |
6de5aa1 to 1576078Comparerefack commented May 13, 2017
Latest CI: https://ci.nodejs.org/job/node-test-commit/9870/ |
refack commented May 15, 2017
@Trott@vsemozhetbyt PTAL
|
vsemozhetbyt commented May 15, 2017
@refack I feel murky on this issue, so I dare not make any definitive review( |
Trott commented May 16, 2017
@nodejs/testing PTAL |
test/parallel/test-fs-chmod.js Outdated
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.
Why the chmod in the exit handler?
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.
If the file stays RO, common.refreshTmpDir fails
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.
Are you certain about that? If so, it must be Windows-only behavior.
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.
Are you certain about that? If so, it must be Windows-only behavior.
Yes, common.refreshTmpDir fails in a few cases on Windows
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.
OK, well in that case, either surrounding it with if (common.isWindows) and/or providing a comment explaining why it's there might help prevent someone like me from coming along and obliviously removing it in six months. :-D
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.
So let's wait with this. I want to fix common.refreshTmpDir on windows.
refack commented May 16, 2017
New CI:https://ci.nodejs.org/job/node-test-commit/9914/ (hopefully we got the flakes out of the way) |
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.
We generally use common.skip to skip tests.
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.
Since this is a known-issue it's supposed to fail.
So it's either this line or exclude this test for all platforms but Windows in known_issues.status
Otherwise we get:
refael@refaelux:/mnt/d/code/node-cur$ python tools/test.py known_issues === release test-fs-fchmod-12835 [negative] === Path: known_issues/test-fs-fchmod-12835 1..0 # Skipped: undefined Command: out/Release/node /mnt/d/code/node-cur/test/known_issues/test-fs-fchmod-12835.js [00:11|% 100|+ 13|- 1]: Done Currently this uncovers a regression in `fs.fchmodSync(fd, mode_sync);` No solution yet... Also as issue on macOS in test-fs-chmod:94 fail to access file1 Fixes:nodejs#12803
refack commented May 20, 2017
Blocking until we fix |
BridgeAR commented Sep 20, 2017
Ping @refack |
| constassert=require('assert'); | ||
| constpath=require('path'); | ||
| constfs=require('fs'); | ||
| const{execSync}=require('child_process'); |
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.
Is the linter not complaining about this without extra whitespace?^^
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.
It seems the rule was landed later than the last CI here.
BridgeAR commented Sep 27, 2017
@refack this needs a rebase |
BridgeAR commented Nov 22, 2017
Closing due to long inactivity. @refack please reopen if you want to further pursue this. |
Currently this uncovers a regression in
fs.fchmodSync(fd, mode_sync);No solution yet...
Fixes:#12803
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
fs,libuv,test