X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fworker-files%2Fthread%2FlongRunningWorkerHardBehavior.js;h=e7d84df9fe0205ab747559c2f8fa390c008349ea;hb=cca3bb1a52271e1b74e3929524faf61521e5c888;hp=7d9714a8140aed85399c5b53aff47a6ec5b2a002;hpb=85a3f8a7b3087e7240c1d307ba6dd78c05883f83;p=poolifier.git diff --git a/tests/worker-files/thread/longRunningWorkerHardBehavior.js b/tests/worker-files/thread/longRunningWorkerHardBehavior.js index 7d9714a8..e7d84df9 100644 --- a/tests/worker-files/thread/longRunningWorkerHardBehavior.js +++ b/tests/worker-files/thread/longRunningWorkerHardBehavior.js @@ -1,14 +1,12 @@ 'use strict' -const { ThreadWorker, KillBehaviors } = require('../../../lib/index') +const { ThreadWorker, KillBehaviors } = require('../../../lib') +const { sleepTaskFunction } = require('../../test-utils') async function sleep (data) { - return new Promise((resolve, reject) => { - setTimeout(() => resolve(data), 50000) - }) + return sleepTaskFunction(data, 50000) } module.exports = new ThreadWorker(sleep, { - maxInactiveTime: 500, - async: true, - killBehavior: KillBehaviors.HARD + killBehavior: KillBehaviors.HARD, + maxInactiveTime: 500 })