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: nodejs#17407
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
bnoordhuis authored and MayaLekova committed May 8, 2018
1 parent 18a9aaf commit 68bc3b2
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 68bc3b2

Please sign in to comment.