1'use strict'; 2const common = require('../common'); 3const { Worker } = require('worker_threads'); 4 5const w = new Worker(` 6const dns = require('dns'); 7dns.lookup('nonexistent.org', () => {}); 8require('worker_threads').parentPort.postMessage('0'); 9`, { eval: true }); 10 11w.on('message', common.mustCall(() => { 12 // This should not crash the worker during a DNS request. 13 w.terminate().then(common.mustCall()); 14})); 15