1'use strict'; 2const common = require('../common'); 3const { Worker } = require('worker_threads'); 4 5// The actual test here is that the Worker does not keep the main thread 6// running after it has been .terminate()’ed. 7 8const w = new Worker(` 9const p = require('worker_threads').parentPort; 10while(true) p.postMessage({})`, { eval: true }); 11w.once('message', () => w.terminate()); 12w.once('exit', common.mustCall()); 13