X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fworker-files%2Fcluster%2FasyncErrorWorker.js;h=0b6f5d8acb937a02bc4dcb47d855f6a89456ddc2;hb=15d563152134452a245e4842b20fbf4030457e16;hp=b9fd9016ab91801122e4cb6394b5e590377b4f3f;hpb=0a01b5c3aa58059e7241d4394cf3953779029507;p=poolifier.git diff --git a/tests/worker-files/cluster/asyncErrorWorker.js b/tests/worker-files/cluster/asyncErrorWorker.js index b9fd9016..0b6f5d8a 100644 --- 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') +const TestUtils = require('../../test-utils') 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, {