repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: fix IWRR worker node removal
[poolifier.git]
/
tests
/
worker-files
/
cluster
/
testWorker.js
diff --git
a/tests/worker-files/cluster/testWorker.js
b/tests/worker-files/cluster/testWorker.js
index a8a6bb9ee14a0e1e670bb12348dfc47a1590b1b3..4511bcaacc72844582382b3a9e260df9dd4dc48a 100644
(file)
--- a/
tests/worker-files/cluster/testWorker.js
+++ b/
tests/worker-files/cluster/testWorker.js
@@
-1,15
+1,15
@@
'use strict'
'use strict'
-const { ClusterWorker } = 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) {
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, { maxInactiveTime: 500 })
+module.exports = new ClusterWorker(test, {
+ killBehavior: KillBehaviors.HARD,
+ maxInactiveTime: 500
+})