Files
node/test/parallel/test-process-exit-after-fetch-throw.js
T
liuxingbaoyu 0fae62c581 src: fix libuv assertion on windows
Ignore `PostDelayedTask` after `Stop`
to avoid assertions.

Fixes: https://github.com/nodejs/node/issues/56645
Signed-off-by: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/61999
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-07-24 06:09:43 +00:00

33 lines
785 B
JavaScript

'use strict';
// Ref: https://github.com/nodejs/node/issues/56645
const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
const http = require('http');
if (process.argv[2] === 'child') {
http
.createServer((_, res) => {
res.writeHead(302, { Location: '/' });
res.end();
})
.listen(0, '127.0.0.1', async function() {
try {
await fetch(`http://127.0.0.1:${this.address().port}/`);
} catch {
// ignore
}
process.exit(0);
});
} else {
const child = cp.spawn(process.execPath, [__filename, 'child']);
child.on(
'close',
common.mustCall((exitCode, signal) => {
assert.strictEqual(exitCode, 0);
assert.strictEqual(signal, null);
}),
);
}