test: account for truthy signal in flaky async_hooks tests · nodejs/node@bef67e4

Original file line numberDiff line numberDiff line change

@@ -52,8 +52,12 @@ if (process.argv[2] === 'child') {

5252

child.stderr.on('data', (d) => { errData = Buffer.concat([ errData, d ]); });

5353

child.stdout.on('data', (d) => { outData = Buffer.concat([ outData, d ]); });

5454
55-

child.on('close', common.mustCall((code) => {

56-

assert.strictEqual(code, 1);

55+

child.on('close', common.mustCall((code, signal) => {

56+

if (signal) {

57+

console.log(`Child closed with signal: ${signal}`);

58+

} else {

59+

assert.strictEqual(code, 1);

60+

}

5761

assert.match(outData.toString(), heartbeatMsg,

5862

'did not crash until we reached offending line of code ' +

5963

`(found ${outData})`);