repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Factor out some UTs code in test-utils.js
[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 b9fd9016ab91801122e4cb6394b5e590377b4f3f..0b6f5d8acb937a02bc4dcb47d855f6a89456ddc2 100644
(file)
--- a/
tests/worker-files/cluster/asyncErrorWorker.js
+++ b/
tests/worker-files/cluster/asyncErrorWorker.js
@@
-1,13
+1,14
@@
'use strict'
const { ClusterWorker, KillBehaviors } = require('../../../lib/index')
'use strict'
const { ClusterWorker, KillBehaviors } = require('../../../lib/index')
+const TestUtils = 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
TestUtils.workerSleepFunction(
+ data,
+
2000
,
+ true,
+ 'Error Message from ClusterWorker:async'
+ )
}
module.exports = new ClusterWorker(error, {
}
module.exports = new ClusterWorker(error, {