diff --git a/lambdas/functions/control-plane/src/scale-runners/scale-up.test.ts b/lambdas/functions/control-plane/src/scale-runners/scale-up.test.ts index 8ac2c14489..72b3c5ef1d 100644 --- a/lambdas/functions/control-plane/src/scale-runners/scale-up.test.ts +++ b/lambdas/functions/control-plane/src/scale-runners/scale-up.test.ts @@ -863,6 +863,20 @@ describe('scaleUp with GHES', () => { }), ); }); + + it('Should assume job is queued when isJobQueued throws (fail-open)', async () => { + mockOctokit.actions.getJobForWorkflowRun.mockRejectedValue(new Error('GitHub API 502')); + + const messages = createTestMessages(2); + await scaleUpModule.scaleUp(messages); + + // All messages processed despite API error — fail-open prevents job drops + expect(createRunner).toHaveBeenCalledWith( + expect.objectContaining({ + numberOfRunners: 2, + }), + ); + }); }); }); diff --git a/lambdas/functions/control-plane/src/scale-runners/scale-up.ts b/lambdas/functions/control-plane/src/scale-runners/scale-up.ts index 395c87e8f8..48333bdc11 100644 --- a/lambdas/functions/control-plane/src/scale-runners/scale-up.ts +++ b/lambdas/functions/control-plane/src/scale-runners/scale-up.ts @@ -416,10 +416,21 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise