Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: improve flakiness detection on stack corruption tests
  • Loading branch information
gulbaki committed Jun 6, 2025
commit 4a23c0f445e5a922c0ea3b267cc4cf03c22c2503
13 changes: 8 additions & 5 deletions test/async-hooks/test-improper-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +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.once('exit', common.mustCall((code, signal) => {
assert.strictEqual(code, 1);
assert.strictEqual(signal, null);
}));

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.
Comment thread
gulbaki marked this conversation as resolved.
Resolved
} 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})`);
Expand Down