Skip to content

Commit

Permalink
test: fix flaky cluster unix socket test
Browse files Browse the repository at this point in the history
Ensure `common.tmpDir` exists before trying to chdir into it.  Fixes a
"ENOENT: no such file or directory, uv_chdir" error when the temporary
directory is removed before running the test.

PR-URL: #17407
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
bnoordhuis authored and MylesBorins committed Feb 21, 2018
1 parent 19abee1 commit cc80914
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/parallel/test-cluster-net-listen-relative-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ assert.strictEqual(path.resolve(socketDir, socketName).length > 100, true,

if (cluster.isMaster) {
// ensure that the worker exits peacefully
common.refreshTmpDir();
process.chdir(common.tmpDir);
fs.mkdirSync(socketDir);
cluster.fork().on('exit', common.mustCall(function(statusCode) {
Expand Down

0 comments on commit cc80914

Please sign in to comment.