mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 03:48:56 +00:00
broken
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
const { Worker } = require('worker_threads');
|
||||
|
||||
const w = new Worker(`
|
||||
const dns = require('dns');
|
||||
dns.lookup('nonexistent.org', () => {});
|
||||
require('worker_threads').parentPort.postMessage('0');
|
||||
`, { eval: true });
|
||||
|
||||
w.on('message', common.mustCall(() => {
|
||||
// This should not crash the worker during a DNS request.
|
||||
w.terminate().then(common.mustCall());
|
||||
}));
|
||||
@@ -1,16 +0,0 @@
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
const { once } = require('events');
|
||||
const { Worker } = require('worker_threads');
|
||||
|
||||
// Test that calling worker.terminate() on an unref()’ed Worker instance
|
||||
// still resolves the returned Promise.
|
||||
|
||||
async function test() {
|
||||
const worker = new Worker('setTimeout(() => {}, 1000000);', { eval: true });
|
||||
await once(worker, 'online');
|
||||
worker.unref();
|
||||
await worker.terminate();
|
||||
}
|
||||
|
||||
test().then(common.mustCall());
|
||||
Reference in New Issue
Block a user