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.refresh() in test-esm-windows.js #30997

Merged
merged 1 commit into from Dec 18, 2019

Conversation

@richardlau
Copy link
Member

richardlau commented Dec 16, 2019

Use tmpdir.refresh() in test/es-module/test-esm-windows.js so
that the temporary directory is cleaned before use and when the test
exits.

The existing test can otherwise fail if the temporary directory is polluted
before running the test:

-bash-4.2$ mkdir -p test/.tmp.0/node_modules
-bash-4.2$ ./tools/test.py es-module/test-esm-windows
=== release test-esm-windows ===
Path: es-module/test-esm-windows
(node:81631) ExperimentalWarning: The ESM module loader is experimental.
/home/users/riclau/sandbox/github/nodejs/test/common/index.js:685
const crashOnUnhandledRejection = (err) => { throw err; };
                                             ^

[Error: EEXIST: file already exists, mkdir '/home/users/riclau/sandbox/github/nodejs/test/.tmp.0/node_modules'] {
  errno: -17,
  code: 'EEXIST',
  syscall: 'mkdir',
  path: '/home/users/riclau/sandbox/github/nodejs/test/.tmp.0/node_modules'
}
Command: out/Release/node /home/users/riclau/sandbox/github/nodejs/test/es-module/test-esm-windows.js
[00:00|% 100|+   0|-   1]: Done
-bash-4.2$

and has been observed failing on the CI: https://ci.nodejs.org/job/node-test-commit-arm/28228/nodes=centos7-arm64-gcc6/consoleFull

16:33:34 not ok 48 es-module/test-esm-windows
16:33:34   ---
16:33:34   duration_ms: 0.411
16:33:34   severity: fail
16:33:34   exitcode: 1
16:33:34   stack: |-
16:33:34     (node:55274) ExperimentalWarning: The ESM module loader is experimental.
16:33:34     /home/iojs/build/workspace/node-test-commit-arm/nodes/centos7-arm64-gcc6/test/common/index.js:704
16:33:34     const crashOnUnhandledRejection = (err) => { throw err; };
16:33:34                                                  ^
16:33:34     
16:33:34     [Error: EEXIST: file already exists, mkdir '/home/iojs/node-tmp/.tmp.1/node_modules'] {
16:33:34       errno: -17,
16:33:34       code: 'EEXIST',
16:33:34       syscall: 'mkdir',
16:33:34       path: '/home/iojs/node-tmp/.tmp.1/node_modules'
16:33:34     }
16:33:34   ...
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
@nodejs-github-bot

This comment was marked as outdated.

test/es-module/test-esm-windows.js Outdated Show resolved Hide resolved
@nodejs-github-bot

This comment has been minimized.

Copy link

nodejs-github-bot commented Dec 17, 2019

@Trott
Trott approved these changes Dec 17, 2019
@lpinca
lpinca approved these changes Dec 17, 2019
@Trott

This comment has been minimized.

Copy link
Member

Trott commented Dec 18, 2019

Worthy of fast-tracking? 👍 here if you're a Collaborator and you agree. Comment if you're a Collaborator and you disagree.

@Trott Trott added the fast-track label Dec 18, 2019
Use `tmpdir.refresh()` in `test/es-module/test-esm-windows.js` so
that the temporary directory is cleaned before use and when the test
exits.

PR-URL: #30997
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@richardlau richardlau force-pushed the richardlau:tmpdir branch from c34ba83 to e23aebc Dec 18, 2019
@richardlau richardlau merged commit e23aebc into nodejs:master Dec 18, 2019
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
@richardlau

This comment has been minimized.

Copy link
Member Author

richardlau commented Dec 18, 2019

Landed in e23aebc.

BridgeAR added a commit that referenced this pull request Jan 3, 2020
Use `tmpdir.refresh()` in `test/es-module/test-esm-windows.js` so
that the temporary directory is cleaned before use and when the test
exits.

PR-URL: #30997
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Jan 7, 2020
MylesBorins added a commit that referenced this pull request Jan 12, 2020
Use `tmpdir.refresh()` in `test/es-module/test-esm-windows.js` so
that the temporary directory is cleaned before use and when the test
exits.

PR-URL: #30997
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.