MCPcopy Index your code
hub / github.com/nodejs/node / test

Function test

test/parallel/test-worker-messaging-errors-timeout.js:13–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11const memory = new SharedArrayBuffer(4);
12
13async function test() {
14 const worker = new Worker(__filename, { workerData: { memory, children: true } });
15 const array = new Int32Array(memory);
16
17 await assert.rejects(common.mustCall(function() {
18 return postMessageToThread(worker.threadId, 0, common.platformTimeout(500));
19 }), {
20 name: 'Error',
21 code: 'ERR_WORKER_MESSAGING_TIMEOUT',
22 });
23
24 Atomics.store(array, 0, 1);
25 Atomics.notify(array, 0);
26}
27
28if (!workerData?.children) {
29 test();

Calls 2

postMessageToThreadFunction · 0.85
storeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…