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: use tmpDir in test-fs-utimes #16774

Closed
wants to merge 1 commit into from
Closed

test: use tmpDir in test-fs-utimes #16774

wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Nov 5, 2017

test-fs-utimes was doing some tests against __filename. This made the
test unreliable when multiple copies were run simultaneously. In
general, tests should use files in either the tmp directory or else
fixtures, so change to using common.tmpDir instead. Each copy of the
test (if using test.py harness for parallel runs) will use its own
directory, making the test robust again.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test fs

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 5, 2017
@mscdex mscdex added the fs Issues and PRs related to the fs subsystem / file system. label Nov 5, 2017
@lpinca
Copy link
Member

lpinca commented Nov 6, 2017

I think we should use common.refreshTmpDir() to handle cases where common.tmpDir does not exists.

test-fs-utimes was doing some tests against __filename. This made the
test unreliable when multiple copies were run simultaneously. In
general, tests should use files in either the tmp directory or else
fixtures, so change to using `common.tmpDir` instead. Each copy of the
test (if using `test.py` harness for parallel runs) will use its own
directory, making the test robust again.
@Trott
Copy link
Member Author

Trott commented Nov 6, 2017

I moved common.refreshTmpDir() to the top. Rebased and force-pushed.

CI: https://ci.nodejs.org/job/node-test-pull-request/11207/

Trott added a commit to Trott/io.js that referenced this pull request Nov 8, 2017
test-fs-utimes was doing some tests against __filename. This made the
test unreliable when multiple copies were run simultaneously. In
general, tests should use files in either the tmp directory or else
fixtures, so change to using `common.tmpDir` instead. Each copy of the
test (if using `test.py` harness for parallel runs) will use its own
directory, making the test robust again.

PR-URL: nodejs#16774
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
@Trott
Copy link
Member Author

Trott commented Nov 8, 2017

Landed in da7b4a9.

@Trott Trott closed this Nov 8, 2017
evanlucas pushed a commit that referenced this pull request Nov 13, 2017
test-fs-utimes was doing some tests against __filename. This made the
test unreliable when multiple copies were run simultaneously. In
general, tests should use files in either the tmp directory or else
fixtures, so change to using `common.tmpDir` instead. Each copy of the
test (if using `test.py` harness for parallel runs) will use its own
directory, making the test robust again.

PR-URL: #16774
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
@evanlucas evanlucas mentioned this pull request Nov 13, 2017
MylesBorins pushed a commit that referenced this pull request Nov 17, 2017
test-fs-utimes was doing some tests against __filename. This made the
test unreliable when multiple copies were run simultaneously. In
general, tests should use files in either the tmp directory or else
fixtures, so change to using `common.tmpDir` instead. Each copy of the
test (if using `test.py` harness for parallel runs) will use its own
directory, making the test robust again.

PR-URL: #16774
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
@gibfahn gibfahn mentioned this pull request Nov 21, 2017
@Trott Trott deleted the 1 branch October 15, 2021 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants