From 58e1cba200df9c1c70221d67d6038a7e7290b29c Mon Sep 17 00:00:00 2001 From: Baki Gul Date: Tue, 3 Jun 2025 14:07:24 +0300 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Zeyu "Alex" Yang Reviewed-By: Joyee Cheung --- test/async-hooks/test-improper-order.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/async-hooks/test-improper-order.js b/test/async-hooks/test-improper-order.js index 5452e2c6e05..f39c79a72bc 100644 --- a/test/async-hooks/test-improper-order.js +++ b/test/async-hooks/test-improper-order.js @@ -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})`);