+ expect(longRunningPool.workers.length).toBe(min)
+ // We need to clean up the resources after our test
+ await longRunningPool.destroy()
+ })
+
+ it('Verify scale processes up and down is working when long running task is used:soft', async () => {
+ const longRunningPool = new DynamicClusterPool(
+ min,
+ max,
+ './tests/worker-files/cluster/longRunningWorkerSoftBehavior.js',
+ {
+ errorHandler: e => console.error(e),
+ onlineHandler: () => console.log('long running worker is online'),
+ exitHandler: () => console.log('long running worker exited')
+ }
+ )
+ expect(longRunningPool.workers.length).toBe(min)
+ for (let i = 0; i < max * 10; i++) {
+ longRunningPool.execute({ test: 'test' })
+ }