fix(core): Ensure worker stops picking up new jobs while shutting down (#13714)

This commit is contained in:
Iván Ovejero
2025-03-10 17:39:41 +01:00
committed by GitHub
parent cbf2476819
commit 4fe249580a
2 changed files with 10 additions and 6 deletions

View File

@@ -202,7 +202,7 @@ describe('ScalingService', () => {
});
describe('if worker', () => {
it('should wait for running jobs to finish', async () => {
it('should pause queue and wait for running jobs to finish', async () => {
// @ts-expect-error readonly property
instanceSettings.instanceType = 'worker';
await scalingService.setupQueue();
@@ -211,7 +211,7 @@ describe('ScalingService', () => {
await scalingService.stop();
expect(getRunningJobsCountSpy).toHaveBeenCalled();
expect(queue.pause).not.toHaveBeenCalled();
expect(queue.pause).toHaveBeenCalled();
expect(stopQueueRecoverySpy).not.toHaveBeenCalled();
});
});