X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fworker-files%2Fcluster%2FlongRunningWorkerHardBehavior.js;h=f2c0c1e40bd1c23671aa62679a0475b08e6c2fb6;hb=a93f5559e2dd5ff7fd49afdd43bc9806cff92f56;hp=04c78f4659738fa053ac67888663833d0a2eb2a1;hpb=85a3f8a7b3087e7240c1d307ba6dd78c05883f83;p=poolifier.git diff --git a/tests/worker-files/cluster/longRunningWorkerHardBehavior.js b/tests/worker-files/cluster/longRunningWorkerHardBehavior.js index 04c78f46..f2c0c1e4 100644 --- a/tests/worker-files/cluster/longRunningWorkerHardBehavior.js +++ b/tests/worker-files/cluster/longRunningWorkerHardBehavior.js @@ -1,14 +1,12 @@ 'use strict' -const { ClusterWorker, KillBehaviors } = require('../../../lib/index') +const { ClusterWorker, 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 ClusterWorker(sleep, { maxInactiveTime: 500, - async: true, killBehavior: KillBehaviors.HARD })