test: deflake async-hooks/test-improper-order on AIX

PR-URL: https://github.com/nodejs/node/pull/58567
Fixes: https://github.com/nodejs/node/issues/58562
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
Baki Gul 2025-06-03 14:07:24 +03:00 committed by Darshan Sen
parent 238af6a8b5
commit 58e1cba200
No known key found for this signature in database
GPG Key ID: AF78F02FFD0C0E3C

View File

@ -51,8 +51,15 @@ if (process.argv[2] === 'child') {
child.stderr.on('data', (d) => { errData = Buffer.concat([ errData, d ]); });
child.stdout.on('data', (d) => { outData = Buffer.concat([ outData, d ]); });
child.on('close', common.mustCall((code) => {
assert.strictEqual(code, 1);
child.on('close', common.mustCall((code, 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,
'did not crash until we reached offending line of code ' +
`(found ${outData})`);