You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

13 lines
398 B

import assert from 'node:assert/strict';
import { test } from 'node:test';
import { resolve } from 'node:path';
import Piscina from '..';
test('can destroy pool while tasks are running', () => {
const pool = new Piscina({
filename: resolve(__dirname, 'fixtures/eval.js')
});
setImmediate(() => pool.destroy());
assert.rejects(pool.run('while(1){}'), /Terminating worker thread/);
});