X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fworker-node.test.mjs;h=549db4b6aa5ae82ac6d87ab3007c376f2e854853;hb=efc4d37dd21d0c80e5fa2d58009e6298eefe5d48;hp=3b87a8485d39e0547707197c8667238ec35a0265;hpb=9974369e3530cf80c21794b59bcbbc4c72e505eb;p=poolifier.git diff --git a/tests/pools/worker-node.test.mjs b/tests/pools/worker-node.test.mjs index 3b87a848..549db4b6 100644 --- a/tests/pools/worker-node.test.mjs +++ b/tests/pools/worker-node.test.mjs @@ -1,11 +1,11 @@ import { MessageChannel, Worker as ThreadWorker } from 'node:worker_threads' import { Worker as ClusterWorker } from 'node:cluster' import { expect } from 'expect' -import { WorkerNode } from '../../lib/pools/worker-node.js' -import { WorkerTypes } from '../../lib/index.js' -import { CircularArray } from '../../lib/circular-array.js' -import { Deque } from '../../lib/deque.js' -import { DEFAULT_TASK_NAME } from '../../lib/utils.js' +import { WorkerNode } from '../../lib/pools/worker-node.cjs' +import { WorkerTypes } from '../../lib/index.cjs' +import { CircularArray } from '../../lib/circular-array.cjs' +import { Deque } from '../../lib/deque.cjs' +import { DEFAULT_TASK_NAME } from '../../lib/utils.cjs' describe('Worker node test suite', () => { const threadWorkerNode = new WorkerNode( @@ -15,7 +15,7 @@ describe('Worker node test suite', () => { ) const clusterWorkerNode = new WorkerNode( WorkerTypes.cluster, - './tests/worker-files/cluster/testWorker.js', + './tests/worker-files/cluster/testWorker.cjs', { tasksQueueBackPressureSize: 12 } ) @@ -124,7 +124,8 @@ describe('Worker node test suite', () => { id: threadWorkerNode.worker.threadId, type: WorkerTypes.thread, dynamic: false, - ready: false + ready: false, + stealing: false }) expect(threadWorkerNode.usage).toStrictEqual({ tasks: { @@ -167,7 +168,8 @@ describe('Worker node test suite', () => { id: clusterWorkerNode.worker.id, type: WorkerTypes.cluster, dynamic: false, - ready: false + ready: false, + stealing: false }) expect(clusterWorkerNode.usage).toStrictEqual({ tasks: {