Sync already-added tests with Node

This commit is contained in:
Ben Grant
2025-03-14 13:41:17 -07:00
parent 66fb9f1097
commit e222f8ceb3
3 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ const { Worker } = require('worker_threads');
`, { eval: true });
w.on('message', common.mustCall(() => {
assert.strictEqual(local.toString(), 'Hello world!');
global.gc();
globalThis.gc();
w.terminate();
}));
w.postMessage({ sharedArrayBuffer });

View File

@@ -8,7 +8,7 @@ for (const fn of ['setTimeout', 'setImmediate', 'setInterval']) {
const worker = new Worker(`
const { parentPort } = require('worker_threads');
${fn}(() => {
parentPort.postMessage({});
require('worker_threads').parentPort.postMessage({});
while (true);
});`, { eval: true });

View File

@@ -23,7 +23,7 @@ const { Worker } = require('worker_threads');
});
w.on('message', common.mustCall(() => {
assert.strictEqual(local.toString(), 'Hello world!');
global.gc();
globalThis.gc();
w.terminate();
}));
w.postMessage({});