From 5f249181223488e8ca48be36b0693bfebe2e5745 Mon Sep 17 00:00:00 2001 From: Lewis Cowles Date: Sat, 22 Apr 2023 05:05:21 +0100 Subject: [PATCH] test: reduce flakiness by taking control of environment I use vs code with auto-attach, which creates data in STDERR This controls the ENV passed through to child-process Technically I think it improves the test --- test/process-exit.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/process-exit.test.js b/test/process-exit.test.js index 46454e17..ca6d796e 100644 --- a/test/process-exit.test.js +++ b/test/process-exit.test.js @@ -16,7 +16,8 @@ if (nodeVer[0] <= 0 && nodeVer[1] <= 8) { console.warn('skip test (node <= 0.8)'); } else { test('log with rotating file stream will terminate', function (t) { - exec('node ' +__dirname + '/process-exit.js', {timeout: 1000}, + exec('node ' +__dirname + '/process-exit.js', + {timeout: 1000, env: { PATH: process.env.PATH }}, function (err, stdout, stderr) { t.ifError(err); t.equal(stdout, 'done\n');