Skip to content
Prev Previous commit
Next Next commit
fixup! fixup! fixup! separate tc for clarify on patch expectations
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
  • Loading branch information
daeyeon committed Apr 17, 2024
commit 35002b698c2b730f385c5f4ab0879fb3c4ad4fa3
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,29 @@ import { fileURLToPath } from 'node:url';
import inspector from 'node:inspector';
import assert from 'node:assert';

// Ref: https://github.com/nodejs/node/issues/52467
// Refs: https://github.com/nodejs/node/issues/52467

let TIMEOUT = common.platformTimeout(5000);
if (common.isWindows) {
// Refs: https://github.com/nodejs/build/issues/3014
TIMEOUT = common.platformTimeout(15000);
}

if (isMainThread) {
// worker.terminate() should terminate the worker and the pending
// inspector.waitForDebugger().
{
const worker = new Worker(fileURLToPath(import.meta.url));
await new Promise((r) => worker.on('message', r));
await new Promise((r) => setTimeout(r, TIMEOUT));
worker.on('exit', common.mustCall());
await worker.terminate();
}
// process.exit() should kill the process.
{
const worker = new Worker(fileURLToPath(import.meta.url));
await new Promise((r) => worker.on('message', r));
await new Promise((r) => setTimeout(r, TIMEOUT));
process.on('exit', (status) => assert.strictEqual(status, 0));
setImmediate(() => process.exit());
}
Expand Down