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 <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Flarna authored and MylesBorins committed Dec 17, 2019
1 parent 10a77d3 commit b6b917d
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 b6b917d

Please sign in to comment.