Uh oh!
There was an error while loading. Please reload this page.
test, fs: fix chmod mask testing on windows - #12835
Conversation
vsemozhetbyt
commented
May 4, 2017
Refs: #12803 |
There was a problem hiding this comment.
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.
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
refack
commented
May 5, 2017
vsemozhetbyt
commented
May 5, 2017
See about |
There was a problem hiding this comment.
This is not necessary if known_issues.status is properly updated, if I get this right.
There was a problem hiding this comment.
I'll need to set it to be excluded for every platform but windows.
This way seems less noisy...
There was a problem hiding this comment.
/bin/sh: copy: command not found in Linux CI.
refack
commented
May 5, 2017
refack
commented
May 5, 2017
There was a problem hiding this comment.
Linter:
11:22 error Strings must use singlequote quotes 11:55 error Missing semicolon semiThere was a problem hiding this comment.
Linter: 78:25 error Strings must use singlequote quotes
There was a problem hiding this comment.
Linter: 79:25 error Strings must use singlequote quotes
There was a problem hiding this comment.
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 |
works so bad on Windows 😭 |
@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 |
There was a problem hiding this comment.
If the file stays RO, common.refreshTmpDir fails
There was a problem hiding this comment.
Are you certain about that? If so, it must be Windows-only behavior.
There was a problem hiding this comment.
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.
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.
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.
We generally use common.skip to skip tests.
There was a problem hiding this comment.
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 |
| const assert = require('assert'); | ||
| const path = require('path'); | ||
| const fs = require('fs'); | ||
| const {execSync} = require('child_process'); |
There was a problem hiding this comment.
Is the linter not complaining about this without extra whitespace?^^
There was a problem hiding this comment.
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