+ min,
+ max,
+ './tests/worker-files/thread/testWorker.js'
+ )
+ const res = await pool1.execute()
+ expect(res).toBe(false)
+ // We need to clean up the resources after our test
+ await pool1.destroy()
+ })
+
+ it('Verify scale thread up and down is working when long running task is used:hard', async () => {
+ const longRunningPool = new DynamicThreadPool(
+ min,
+ max,
+ './tests/worker-files/thread/longRunningWorkerHardBehavior.js',
+ {
+ errorHandler: e => console.error(e),
+ onlineHandler: () => console.log('long running worker is online'),
+ exitHandler: () => console.log('long running worker exited')
+ }