Skip to content

Commit 7533020

Browse files
committed
Remove workaround for worker.terminate() crashes
Looks like the patch is included in all supported Node.js versions.
1 parent 10e2e8a commit 7533020

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

lib/fork.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {fileURLToPath} from 'node:url';
44
import {Worker} from 'node:worker_threads';
55

66
import Emittery from 'emittery';
7-
import {pEvent} from 'p-event';
87

98
import {controlFlow} from './ipc-flow-control.cjs';
109
import serializeError from './serialize-error.js';
@@ -35,13 +34,8 @@ const createWorker = (options, execArgv) => {
3534
});
3635
postMessage = worker.postMessage.bind(worker);
3736

38-
// Ensure we've seen this event before we terminate the worker thread, as a
39-
// workaround for https://github.com/nodejs/node/issues/38418.
40-
const starting = pEvent(worker, 'message', ({ava}) => ava?.type === 'starting');
41-
4237
close = async () => {
4338
try {
44-
await starting;
4539
await worker.terminate();
4640
} finally {
4741
// No-op

0 commit comments

Comments
 (0)