Skip to content

Commit

Permalink
test: avoid leftover report file
Browse files Browse the repository at this point in the history
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: #30925
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Flarna authored and targos committed Jan 14, 2020
1 parent 78cf6d0 commit 4651871
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/parallel/test-windows-failed-heap-allocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4651871

Please sign in to comment.