From 152697cb98a984f0a23d08680f993661f4ff1043 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 12:52:59 +0000 Subject: [PATCH 1/3] Initial plan From 3eda8adf59ba70d75d4c97f7bd2745b8520894f7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 12:59:58 +0000 Subject: [PATCH 2/3] Add listEC2Runners verification to maximum runners test Co-authored-by: stuartp44 <1926002+stuartp44@users.noreply.github.com> --- .gitignore | 1 + .../control-plane/src/scale-runners/scale-up.test.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 276fe10733..2cd0981f6b 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ secrets.auto.tfvars node_modules/ site/ +lambdas/package-lock.json 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 9549e7cb2d..1342026fd3 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 @@ -1756,6 +1756,13 @@ describe('Retry mechanism tests', () => { await scaleUpModule.scaleUp(messages); + // Verify listEC2Runners is called to check current runner count + expect(listEC2Runners).toBeCalledWith({ + environment: 'unit-test-environment', + runnerType: 'Org', + runnerOwner: TEST_DATA_SINGLE.repositoryOwner, + }); + // publishRetryMessage should still be called even though no runners will be created expect(mockPublishRetryMessage).toHaveBeenCalledTimes(2); expect(createRunner).not.toHaveBeenCalled(); From fd5fb2825487ca77e68c0be5a4d3f7fb2e7ec322 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 13:01:27 +0000 Subject: [PATCH 3/3] Use toHaveBeenCalledWith for better consistency Co-authored-by: stuartp44 <1926002+stuartp44@users.noreply.github.com> --- .../functions/control-plane/src/scale-runners/scale-up.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1342026fd3..49f2e058a3 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 @@ -1757,7 +1757,7 @@ describe('Retry mechanism tests', () => { await scaleUpModule.scaleUp(messages); // Verify listEC2Runners is called to check current runner count - expect(listEC2Runners).toBeCalledWith({ + expect(listEC2Runners).toHaveBeenCalledWith({ environment: 'unit-test-environment', runnerType: 'Org', runnerOwner: TEST_DATA_SINGLE.repositoryOwner,