Skip to content

Commit c7ab7a3

Browse files
bnoordhuisFishrock123
authored andcommitted
test: fix abort/test-abort-uncaught-exception
The --abort-on-uncaught-exception can terminate the process with either a SIGABRT or a SIGILL signal but the test only expected SIGABRT. PR-URL: #6734 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 4b0ab5b commit c7ab7a3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/abort/test-abort-uncaught-exception.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,26 @@ if (process.argv[2] === 'child') {
99
throw new Error('child error');
1010
} else {
1111
run('', null);
12-
run('--abort-on-uncaught-exception', 'SIGABRT');
12+
run('--abort-on-uncaught-exception', ['SIGABRT', 'SIGILL']);
1313
}
1414

15-
function run(flags, signal) {
15+
function run(flags, signals) {
1616
const args = [__filename, 'child'];
1717
if (flags)
1818
args.unshift(flags);
1919

2020
const child = spawn(node, args);
2121
child.on('exit', common.mustCall(function(code, sig) {
22-
if (!common.isWindows) {
23-
assert.strictEqual(sig, signal);
24-
} else {
25-
if (signal)
22+
if (common.isWindows) {
23+
if (signals)
2624
assert.strictEqual(code, 3);
2725
else
2826
assert.strictEqual(code, 1);
27+
} else {
28+
if (signals)
29+
assert.strictEqual(signals.includes(sig), true);
30+
else
31+
assert.strictEqual(sig, null);
2932
}
3033
}));
3134
}

0 commit comments

Comments
 (0)