Skip to content

Commit dc39ffe

Browse files
Copilotpelikhan
andauthored
Fix failing JS Tests (shard 3/4): align create_issue retry test assertions with RATE_LIMIT_RETRY_CONFIG (#29647)
* Initial plan * Fix failing JS tests (shard 3/4): update create_issue retry tests for RATE_LIMIT_RETRY_CONFIG The tests were written for the old config (maxRetries: 3, maxDelayMs: 45000, jitterMs: 10000) but RATE_LIMIT_RETRY_CONFIG was updated to (maxRetries: 5, maxDelayMs: 240000, jitterMs: 5000). Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f7056025-9949-46e1-8ecd-caa9379bfce9 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 613b8ce commit dc39ffe

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

actions/setup/js/create_issue.test.cjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ describe("create_issue", () => {
734734

735735
expect(result.success).toBe(false);
736736
expect(result.error).toBeDefined();
737-
// 1 initial + 3 retries = 4 calls
738-
expect(mockGithub.rest.issues.create).toHaveBeenCalledTimes(4);
737+
// 1 initial + 5 retries = 6 calls (RATE_LIMIT_RETRY_CONFIG.maxRetries = 5)
738+
expect(mockGithub.rest.issues.create).toHaveBeenCalledTimes(6);
739739
});
740740

741741
it("should have retry delays that never exceed maxDelayMs + jitterMs", async () => {
@@ -762,9 +762,9 @@ describe("create_issue", () => {
762762
await vi.runAllTimersAsync();
763763
await resultPromise;
764764

765-
// create_issue uses { initialDelayMs: 15000, maxDelayMs: 45000, jitterMs: 10000 }
766-
// Maximum possible delay per retry = maxDelayMs + jitterMs = 55000ms
767-
const maxBound = 55000;
765+
// create_issue uses RATE_LIMIT_RETRY_CONFIG: { initialDelayMs: 15000, maxDelayMs: 240000, jitterMs: 5000 }
766+
// Maximum possible delay per retry = maxDelayMs + jitterMs = 245000ms
767+
const maxBound = 245000;
768768
// Filter out short setTimeout calls (e.g. from test infrastructure) to isolate retry delays
769769
const sleepDelays = setTimeoutSpy.mock.calls.filter(([, ms]) => ms > 1000).map(([, ms]) => ms);
770770

0 commit comments

Comments
 (0)