From fefb2407eb6cd35726dac332ed2a5e54cb900851 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 20 Jan 2018 01:00:34 +0100 Subject: [PATCH] test: fix flaky cluster unix socket test 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. --- test/parallel/test-cluster-net-listen-relative-path.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/parallel/test-cluster-net-listen-relative-path.js b/test/parallel/test-cluster-net-listen-relative-path.js index 0fcc6a0dca4160..2f95d05203d424 100644 --- a/test/parallel/test-cluster-net-listen-relative-path.js +++ b/test/parallel/test-cluster-net-listen-relative-path.js @@ -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) {