Skip to content

Conversation

@refack
Copy link
Contributor

@refackrefack commented May 4, 2017

Currently this uncovers a regression in fs.fchmodSync(fd, mode_sync);
No solution yet...

Fixes:#12803

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

fs,libuv,test

@refackrefack added the help wanted Issues that need assistance from volunteers or PRs that need help to proceed. label May 4, 2017
@refackrefack self-assigned this May 4, 2017
@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label May 4, 2017
@vsemozhetbyt
Copy link
Contributor

Refs: #12803

@refackrefack added fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding. labels May 4, 2017
Copy link
Member

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.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Good idea!

Copy link
ContributorAuthor

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
Copy link
ContributorAuthor

/cc @nodejs/fs
CI: https://ci.nodejs.org/job/node-test-commit/9644/

@vsemozhetbyt
Copy link
Contributor

@refack
Copy link
ContributorAuthor

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented May 4, 2017

@refack
Copy link
ContributorAuthor

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obsolete)

@vsemozhetbyt
Copy link
Contributor

See about known_issues.status file here.

Copy link
Contributor

@vsemozhetbytvsemozhetbytMay 5, 2017

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.

Copy link
ContributorAuthor

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...

Copy link
Contributor

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.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@refack
Copy link
ContributorAuthor

@refack
Copy link
ContributorAuthor

Copy link
Contributor

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 semi

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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

@refackrefackforce-pushed the 12803-chmod-edge branch from e2cdcf0 to c07479eCompareMay 5, 2017 13:36
@refack
Copy link
ContributorAuthor

@vsemozhetbyt de-linted.

P.S. how do you run the lint locally, I couldn't find a good command?

@sam-github
Copy link
Contributor

@refackmake lint?

@refack
Copy link
ContributorAuthor

refack commented May 5, 2017

@refack make lint?

works so bad on Windows 😭

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented May 5, 2017

@refack
For all:

node tools/eslint/bin/eslint.js --rulesdir tools/eslint-rules/ --ext=.js,.md benchmark doc lib test tools

or just:

eslint --rulesdir tools/eslint-rules/ --ext=.js,.md benchmark doc lib test tools

For a file:

eslint --rulesdir tools/eslint-rules/ path/to/a/file.jseslint --rulesdir tools/eslint-rules/ path/to/a/file.md

@refack
Copy link
ContributorAuthor

@refack
Copy link
ContributorAuthor

@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

364 parallel/test-fs-chmod duration_ms 0.204 severity fail stack written written some more fs.js:934 binding.stat(pathModule._makeLong(path)); ^ Error: ENOENT: no such file or directory, stat '/Users/iojs/node-tmp/tmp.1/1494002742913duck.js' at Object.fs.statSync (fs.js:934:11) at fs.chmod.common.mustCall (/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1010/test/parallel/test-fs-chmod.js:94:18) at /Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1010/test/common/index.js:460:15 at FSReqWrap.oncomplete (fs.js:135:15) 

@refackrefackforce-pushed the 12803-chmod-edge branch from c07479e to c4ce793CompareMay 13, 2017 02:58
@refack
Copy link
ContributorAuthor

@refack
Copy link
ContributorAuthor

@refack
Copy link
ContributorAuthor

@refackrefackforce-pushed the 12803-chmod-edge branch 3 times, most recently from 6de5aa1 to 1576078CompareMay 13, 2017 20:14
@refack
Copy link
ContributorAuthor

Latest CI: https://ci.nodejs.org/job/node-test-commit/9870/
Found an issue on macOS, but couldn't distill it into a known-issue test

@refack
Copy link
ContributorAuthor

@Trott@vsemozhetbyt PTAL
Current test uncovers two issues

  1. Windows distilled into test-fs-fchmod-12835.js
  2. An issue on macOS with short fileWriteSynctest, fs: fix chmod mask testing on windows #12835 (comment)

@refackrefack added macos Issues and PRs related to the macOS platform / OSX. and removed help wanted Issues that need assistance from volunteers or PRs that need help to proceed. labels May 15, 2017
@vsemozhetbyt
Copy link
Contributor

@refack I feel murky on this issue, so I dare not make any definitive review(

@Trott
Copy link
Member

@nodejs/testing PTAL

Copy link
Member

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?

Copy link
ContributorAuthor

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

Copy link
Member

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.

Copy link
ContributorAuthor

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

Copy link
Member

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

Copy link
ContributorAuthor

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
Copy link
ContributorAuthor

New CI:https://ci.nodejs.org/job/node-test-commit/9914/ (hopefully we got the flakes out of the way)

Copy link
Contributor

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.

Copy link
ContributorAuthor

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 

@refackrefackforce-pushed the 12803-chmod-edge branch from 1576078 to 938b8c1CompareMay 16, 2017 19:29
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
@refackrefackforce-pushed the 12803-chmod-edge branch from 938b8c1 to 52e3483CompareMay 19, 2017 19:40
@refackrefack added the blocked PRs that are blocked by other issues or PRs. label May 20, 2017
@refack
Copy link
ContributorAuthor

Blocking until we fix common.refreshTmpDir on Windows

@refackrefack removed the blocked PRs that are blocked by other issues or PRs. label Aug 20, 2017
@BridgeAR
Copy link
Member

Ping @refack

constassert=require('assert');
constpath=require('path');
constfs=require('fs');
const{execSync}=require('child_process');
Copy link
Member

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?^^

Copy link
Contributor

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
Copy link
Member

@refack this needs a rebase

@BridgeAR
Copy link
Member

Closing due to long inactivity. @refack please reopen if you want to further pursue this.

@refackrefack removed their assignment Oct 12, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fsIssues and PRs related to the fs subsystem / file system.libuvIssues and PRs related to the libuv dependency or the uv binding.macosIssues and PRs related to the macOS platform / OSX.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs, test: one set of file attributes in Windows prevents fs.fchmod() from changing mode to RW and breaks incomplete test

8 participants

@refack@vsemozhetbyt@sam-github@Trott@BridgeAR@jasnell@thefourtheye@nodejs-github-bot