Skip to content

Commit b2bfacb

Browse files
FlarnaBridgeAR
authored andcommitted
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: #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>
1 parent 3ead1c2 commit b2bfacb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/parallel/test-windows-failed-heap-allocation.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ if (process.argv[2] === 'heapBomb') {
1414
fn(2);
1515
}
1616

17+
// Run child in tmpdir to avoid report files in repo
18+
const tmpdir = require('../common/tmpdir');
19+
tmpdir.refresh();
20+
1721
// --max-old-space-size=3 is the min 'old space' in V8, explodes fast
1822
const cmd = `"${process.execPath}" --max-old-space-size=3 "${__filename}"`;
19-
exec(`${cmd} heapBomb`, common.mustCall((err) => {
23+
exec(`${cmd} heapBomb`, { cwd: tmpdir.path }, common.mustCall((err) => {
2024
const msg = `Wrong exit code of ${err.code}! Expected 134 for abort`;
2125
// Note: common.nodeProcessAborted() is not asserted here because it
2226
// returns true on 134 as well as 0xC0000005 (V8's base::OS::Abort)

0 commit comments

Comments
 (0)