repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(ci): test TS configuration support in sonar cloud action
[poolifier.git]
/
tests
/
worker-files
/
cluster
/
asyncErrorWorker.js
diff --git
a/tests/worker-files/cluster/asyncErrorWorker.js
b/tests/worker-files/cluster/asyncErrorWorker.js
index 2476853b55520ab5fea4c917fb70d0f05c66dfa0..028a7cf3a77a97689442576fb40d6457c623df8c 100644
(file)
--- a/
tests/worker-files/cluster/asyncErrorWorker.js
+++ b/
tests/worker-files/cluster/asyncErrorWorker.js
@@
-1,16
+1,17
@@
'use strict'
'use strict'
-const { ClusterWorker } = require('../../../lib/index')
+const { ClusterWorker, KillBehaviors } = require('../../../lib')
+const { sleepTaskFunction } = require('../../test-utils')
async function error (data) {
async function error (data) {
- return
new Promise((resolve, reject) => {
- setTimeout(
-
() => reject(new Error('Error Message from ClusterWorker:async'))
,
- 2000
- )
-
}
)
+ return
sleepTaskFunction(
+ data,
+
2000
,
+ true,
+ 'Error Message from ClusterWorker:async'
+ )
}
module.exports = new ClusterWorker(error, {
maxInactiveTime: 500,
}
module.exports = new ClusterWorker(error, {
maxInactiveTime: 500,
- async: true
+ killBehavior: KillBehaviors.HARD
})
})