X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fworker-files%2Fcluster%2FtestWorker.js;h=4511bcaacc72844582382b3a9e260df9dd4dc48a;hb=b6fea09e6a8174e664770741943cf08445066e2b;hp=456da63b7bc60348711df9d1cad3323f22928cce;hpb=6db75ad932064c1415ff6f03645929530209a5fe;p=poolifier.git diff --git a/tests/worker-files/cluster/testWorker.js b/tests/worker-files/cluster/testWorker.js index 456da63b..4511bcaa 100644 --- a/tests/worker-files/cluster/testWorker.js +++ b/tests/worker-files/cluster/testWorker.js @@ -1,17 +1,15 @@ 'use strict' -const { ClusterWorker, KillBehaviors } = require('../../../lib/index') -const { isMaster } = require('cluster') -const TestUtils = require('../../test-utils') -const WorkerFunctions = require('../../test-types') +const { ClusterWorker, KillBehaviors } = require('../../../lib') +const { executeTaskFunction } = require('../../test-utils') +const { TaskFunctions } = require('../../test-types') function test (data) { data = data || {} - data.function = data.function || WorkerFunctions.jsonIntegerSerialization - TestUtils.executeWorkerFunction(data) - return isMaster + data.function = data.function || TaskFunctions.jsonIntegerSerialization + return executeTaskFunction(data) } module.exports = new ClusterWorker(test, { - maxInactiveTime: 500, - killBehavior: KillBehaviors.HARD + killBehavior: KillBehaviors.HARD, + maxInactiveTime: 500 })