fix: revert now unneeded workaround
[poolifier.git] / tests / pools / cluster / fixed.test.js
index 631c59f02d177b739c85bf11f2ae219087353f43..48455f18011ded1507929a5a74bb06077fda45af 100644 (file)
@@ -1,7 +1,7 @@
 const { expect } = require('expect')
 const { FixedClusterPool, PoolEvents } = require('../../../lib')
 const { WorkerFunctions } = require('../../test-types')
-const TestUtils = require('../../test-utils')
+const { waitWorkerEvents } = require('../../test-utils')
 
 describe('Fixed cluster pool test suite', () => {
   const numberOfWorkers = 6
@@ -147,6 +147,7 @@ describe('Fixed cluster pool test suite', () => {
     expect(typeof inError === 'string').toBe(true)
     expect(inError).toBe('Error Message from ClusterWorker')
     expect(taskError).toStrictEqual({
+      workerId: expect.any(Number),
       message: 'Error Message from ClusterWorker',
       data
     })
@@ -173,6 +174,7 @@ describe('Fixed cluster pool test suite', () => {
     expect(typeof inError === 'string').toBe(true)
     expect(inError).toBe('Error Message from ClusterWorker:async')
     expect(taskError).toStrictEqual({
+      workerId: expect.any(Number),
       message: 'Error Message from ClusterWorker:async',
       data
     })
@@ -193,11 +195,7 @@ describe('Fixed cluster pool test suite', () => {
   })
 
   it('Shutdown test', async () => {
-    const exitPromise = TestUtils.waitWorkerEvents(
-      pool,
-      'exit',
-      numberOfWorkers
-    )
+    const exitPromise = waitWorkerEvents(pool, 'exit', numberOfWorkers)
     await pool.destroy()
     const numberOfExitEvents = await exitPromise
     expect(numberOfExitEvents).toBe(numberOfWorkers)