From b6b917dda0c77f53b3f36107b976b651206925df Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Fri, 13 Dec 2019 00:28:24 +0100 Subject: [PATCH] test: avoid leftover report file test-windows-failed-heap-allocation forces a out of mem crash resulting in a report file. To avoid a leftover in repo the child is started in a tmp folder like in test-report-fatal-error. PR-URL: https://github.com/nodejs/node/pull/30925 Reviewed-By: Anna Henningsen Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Jiawen Geng Reviewed-By: David Carlier Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca --- test/parallel/test-windows-failed-heap-allocation.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-windows-failed-heap-allocation.js b/test/parallel/test-windows-failed-heap-allocation.js index ff8062855d6428..1681f0d871e416 100644 --- a/test/parallel/test-windows-failed-heap-allocation.js +++ b/test/parallel/test-windows-failed-heap-allocation.js @@ -14,9 +14,13 @@ if (process.argv[2] === 'heapBomb') { fn(2); } +// Run child in tmpdir to avoid report files in repo +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + // --max-old-space-size=3 is the min 'old space' in V8, explodes fast const cmd = `"${process.execPath}" --max-old-space-size=3 "${__filename}"`; -exec(`${cmd} heapBomb`, common.mustCall((err) => { +exec(`${cmd} heapBomb`, { cwd: tmpdir.path }, common.mustCall((err) => { const msg = `Wrong exit code of ${err.code}! Expected 134 for abort`; // Note: common.nodeProcessAborted() is not asserted here because it // returns true on 134 as well as 0xC0000005 (V8's base::OS::Abort)