test: improve flakiness detection on stack corruption tests

This change skips asserting the exit code of the child process with the
corrupted async hooks stack only on those platforms where termination
via a signal has been observed.

Refs: https://github.com/nodejs/node/pull/58478#discussion_r2132170010
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/58601
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Darshan Sen 2025-06-08 18:47:08 +05:30 committed by Antoine du Hamel
parent 73a97d47f3
commit 0f6a262744
No known key found for this signature in database
GPG Key ID: 21D900FFDB233756
2 changed files with 10 additions and 4 deletions

View File

@ -53,9 +53,12 @@ if (process.argv[2] === 'child') {
child.stdout.on('data', (d) => { outData = Buffer.concat([ outData, d ]); });
child.on('close', common.mustCall((code, signal) => {
if (signal) {
console.log(`Child closed with signal: ${signal}`);
if ((common.isAIX ||
(common.isLinux && process.arch === 'x64')) &&
signal === 'SIGABRT') {
// XXX: The child process could be aborted due to unknown reasons. Work around it.
} else {
assert.strictEqual(signal, null);
assert.strictEqual(code, 1);
}
assert.match(outData.toString(), heartbeatMsg,

View File

@ -56,9 +56,12 @@ if (process.argv[2] === 'child') {
child.stdout.on('data', (d) => { outData = Buffer.concat([ outData, d ]); });
child.on('close', common.mustCall((code, signal) => {
if (signal) {
console.log(`Child closed with signal: ${signal}`);
if ((common.isAIX ||
(common.isLinux && process.arch === 'x64')) &&
signal === 'SIGABRT') {
// XXX: The child process could be aborted due to unknown reasons. Work around it.
} else {
assert.strictEqual(signal, null);
assert.strictEqual(code, 1);
}
assert.match(outData.toString(), heartbeatMsg,