X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fworker-files%2Fthread%2FlongRunningWorkerSoftBehavior.js;h=eda5a4059643c3efd092a9e269ad54b18fc8ecd7;hb=daf86646c7cdb484ec05165a49c12224da11a4c7;hp=eed0586fd2e7d9254e81b1f6e51ad76b8914be19;hpb=85a3f8a7b3087e7240c1d307ba6dd78c05883f83;p=poolifier.git diff --git a/tests/worker-files/thread/longRunningWorkerSoftBehavior.js b/tests/worker-files/thread/longRunningWorkerSoftBehavior.js index eed0586f..eda5a405 100644 --- a/tests/worker-files/thread/longRunningWorkerSoftBehavior.js +++ b/tests/worker-files/thread/longRunningWorkerSoftBehavior.js @@ -1,13 +1,11 @@ 'use strict' -const { ThreadWorker } = require('../../../lib/index') +const { ThreadWorker } = require('../../../lib') +const { sleepWorkerFunction } = require('../../test-utils') async function sleep (data) { - return new Promise((resolve, reject) => { - setTimeout(() => resolve(data), 50000) - }) + return sleepWorkerFunction(data, 50000) } module.exports = new ThreadWorker(sleep, { - maxInactiveTime: 500, - async: true + maxInactiveTime: 500 })