Skip to content
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

test: add test cases for fsPromises #19064

Closed
wants to merge 1 commit into from

Conversation

watilde
Copy link
Contributor

@watilde watilde commented Feb 28, 2018

Add tests of lchmod, chown, fchown and lchown. These tests will increase the coverage of fs/promises: https://coverage.nodejs.org/coverage-3f78d3fcf8029a0a/root/fs/promises.js.html.

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

test

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 28, 2018
@watilde
Copy link
Contributor Author

watilde commented Feb 28, 2018

@@ -35,6 +39,8 @@ const {
} = fsPromises;

const tmpDir = tmpdir.path;
const gid = process.getgid();
Copy link
Contributor

Choose a reason for hiding this comment

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

These functions are not available on Windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops... I will fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I added !common.isWindows.

Copy link
Member

@benjamingr benjamingr left a comment

Choose a reason for hiding this comment

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

Approving given green CI (and the windows fix)

Add tests of lchmod, chown, fchown and lchown.
Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

LGTM, although some basic assertions that the function calls are actually working as intended would be nice.

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 1, 2018
@watilde
Copy link
Contributor Author

watilde commented Mar 2, 2018

landed in c05c73a

@watilde watilde closed this Mar 2, 2018
@watilde watilde deleted the test/fs-promise branch March 2, 2018 22:04
watilde added a commit that referenced this pull request Mar 2, 2018
Add tests of lchmod, chown, fchown and lchown.

PR-URL: #19064
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@Trott
Copy link
Member

Trott commented Mar 3, 2018

Unfortunately, this appears to be flaky on Raspberry Pi in CI: https://ci.nodejs.org/job/node-test-binary-arm/13951/RUN_SUBSET=1,label=pi3-raspbian-jessie/console

18:17:41 not ok 79 parallel/test-fs-promises
18:17:41   ---
18:17:41   duration_ms: 1.23
18:17:41   severity: fail
18:17:41   stack: |-
18:17:41     (node:1568) ExperimentalWarning: The fs/promises API is experimental
18:17:41     /home/iojs/build/workspace/node-test-binary-arm/test/common/index.js:766
18:17:41                  (err) => process.nextTick(() => { throw err; }));
18:17:41                                                    ^
18:17:41     
18:17:41     Error: EPERM: operation not permitted, chown '/home/iojs/build/workspace/node-test-binary-arm/test/.tmp.0/baz.js'

Can we revert until it's sorted out?

@Trott
Copy link
Member

Trott commented Mar 3, 2018

It looks like it failed in the CI run for this PR: https://ci.nodejs.org/job/node-test-binary-arm/13910/RUN_SUBSET=2,label=pi3-raspbian-jessie/console

I think it may be failing 100%, not merely flaky/unreliable.

Trott added a commit to Trott/io.js that referenced this pull request Mar 3, 2018
This reverts commit c05c73a.

The commit breaks Raspberry Pi CI.

Refs: nodejs#19064 (comment)
@Trott
Copy link
Member

Trott commented Mar 3, 2018

PR to revert: #19101

If fixing it is simple/easy, then I'd be happy to see a fix land instead.

One thing that might be relevant is that I think the Pi devices have their temp directories mounted over NFS. So that may be a cause of fs oddities not seen on other devices. Although it is strange that it's only showing up on one of the three Pi variants, so I'm not really sure what's going on (but also didn't look very close TBH).

/cc @rvagg @nodejs/build

@watilde
Copy link
Contributor Author

watilde commented Mar 3, 2018

Wow... I'm sorry for my commit and thank you for the revert PR Rich. I also will investigate the logs.

@Trott
Copy link
Member

Trott commented Mar 3, 2018

Wow... I'm sorry for my commit and thank you for the revert PR Rich. I also will investigate the logs.

No problem. These things tend to happen when CI is permanently red already. :-( Definitely have to get that fixed....

Trott added a commit to Trott/io.js that referenced this pull request Mar 3, 2018
This reverts commit c05c73a.

The commit breaks Raspberry Pi CI.

PR-URL: nodejs#19101
Ref: nodejs#19064 (comment)
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@joyeecheung
Copy link
Member

BTW I am also seeing the same error on Windows 10 + VS2017

@joyeecheung
Copy link
Member

Ah, never mind, I am seeing errors from symlink, which is not touched by this PR

@rvagg
Copy link
Member

rvagg commented Mar 4, 2018

Yeah, that's it @Trott, can't chown on the nfs mount even for the same uid/gid. The problem I think is that the current config is all_squash from the server and forces a particular uid and gid so the nfs client has no control over ownership. This doesn't have to be the case, I could opt for a more sophisticated idmapd thing. We had that running at one stage but it's really hard to get right so for this new NFS server I opted for the simple option.

I'm loath to try and figure it out right now cause once I start messing with NFS it's a big investment to follow it through to completion and I don't have such a large block of time atm. Could we just add a armv6 & armv7 exclusion in the tests for now for this? The idea behind expanding coverage to this functionality is good, it's just our infra getting in the way.

@Trott
Copy link
Member

Trott commented Mar 4, 2018

@rvagg I think the ideal solution is to fix the test to accommodate this situation rather than alter the setup on the Raspberry Pi devices. I have to imagine existing fs tests work around this issue somehow already.

@addaleax addaleax added dont-land-on-v9.x and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Mar 5, 2018
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Add tests of lchmod, chown, fchown and lchown.

PR-URL: nodejs#19064
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
This reverts commit c05c73a.

The commit breaks Raspberry Pi CI.

PR-URL: nodejs#19101
Ref: nodejs#19064 (comment)
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants