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.
11 lines
365 B
11 lines
365 B
import Piscina from '..';
|
|
import { test } from 'tap';
|
|
import { resolve } from 'path';
|
|
|
|
test('can destroy pool while tasks are running', async ({ rejects }) => {
|
|
const pool = new Piscina({
|
|
filename: resolve(__dirname, 'fixtures/eval.js')
|
|
});
|
|
setImmediate(() => pool.destroy());
|
|
await rejects(pool.runTask('while(1){}'), /Terminating worker thread/);
|
|
});
|