X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fworker-files%2Fcluster%2FtestWorker.js;h=8462307cd8826a5b7328ea46405c84a0fbbaf00d;hb=de2e7182cca6b34b000a09bf6d0ddcff4757db3a;hp=7caad9476da291f19319b981c67e8115ac0e32a7;hpb=6fdc721bfdc82852c19cf4d53e0918c9665a580f;p=poolifier.git diff --git a/tests/worker-files/cluster/testWorker.js b/tests/worker-files/cluster/testWorker.js index 7caad947..8462307c 100644 --- a/tests/worker-files/cluster/testWorker.js +++ b/tests/worker-files/cluster/testWorker.js @@ -1,15 +1,12 @@ 'use strict' -const { ClusterWorker, KillBehaviors } = require('../../../lib/index') -const { isMaster } = require('cluster') +const { ClusterWorker, KillBehaviors } = require('../../../lib') +const { executeTaskFunction } = require('../../test-utils') +const { TaskFunctions } = require('../../test-types') function test (data) { - for (let i = 0; i <= 50; i++) { - const o = { - a: i - } - JSON.stringify(o) - } - return isMaster + data = data || {} + data.function = data.function || TaskFunctions.jsonIntegerSerialization + return executeTaskFunction(data) } module.exports = new ClusterWorker(test, {