X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fworker-files%2Fcluster%2FlongRunningWorkerSoftBehavior.js;h=cd057ef06562455a2b30a93140ba23efa404c568;hb=563b18cd8fe9c211f15e9da91a299f2819abea01;hp=c4c00f6a17f41303be6636f59ebf2cb114adb153;hpb=85a3f8a7b3087e7240c1d307ba6dd78c05883f83;p=poolifier.git diff --git a/tests/worker-files/cluster/longRunningWorkerSoftBehavior.js b/tests/worker-files/cluster/longRunningWorkerSoftBehavior.js index c4c00f6a..cd057ef0 100644 --- a/tests/worker-files/cluster/longRunningWorkerSoftBehavior.js +++ b/tests/worker-files/cluster/longRunningWorkerSoftBehavior.js @@ -1,13 +1,11 @@ 'use strict' -const { ClusterWorker } = require('../../../lib/index') +const { ClusterWorker } = 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 + maxInactiveTime: 500 })