Skip to content

Fix flaky tests caused by installation-level API rate limiting#31556

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-tests-again
May 11, 2026
Merged

Fix flaky tests caused by installation-level API rate limiting#31556
pelikhan merged 2 commits into
mainfrom
copilot/fix-tests-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

Bug Fix

What was the bug?

Multiple CI jobs were failing with HTTP 403: API rate limit exceeded for installation during burst windows when concurrent runs share the same installation token quota.

How did you fix it?

ci.yml — DIFC proxy gh CLI test

Swapped gh api /repos/${{ github.repository }} for gh api /rate_limit. The /rate_limit endpoint is exempt from GitHub rate limits, so it can never 403 on quota exhaustion while still making a real authenticated call through the proxy.

frontmatter_hash_github_api.test.cjs — live API integration test

  • Replaced the inline LIVE_API_RETRY_CONFIG (3 retries × 1 s initial delay ≈ 14 s total headroom) with the existing RATE_LIMIT_RETRY_CONFIG (5 retries, 15 s initial delay, 2× backoff, 4 min cap), which is designed for installation-level rate limit reset windows.
  • Increased the Vitest timeout to LIVE_API_TEST_TIMEOUT_MS (18 min) to match the longer worst-case retry sequence (~11.5 min) before the 20 min CI job deadline.

Copilot AI and others added 2 commits May 11, 2026 18:19
…y test, upgrade JS live API retry config

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…omment

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Fix rate-limit-sensitive tests Fix flaky tests caused by installation-level API rate limiting May 11, 2026
Copilot AI requested a review from pelikhan May 11, 2026 18:21
@pelikhan pelikhan marked this pull request as ready for review May 11, 2026 18:46
Copilot AI review requested due to automatic review settings May 11, 2026 18:46
@pelikhan pelikhan merged commit d5491bf into main May 11, 2026
@pelikhan pelikhan deleted the copilot/fix-tests-again branch May 11, 2026 18:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes CI/test flakiness caused by GitHub App installation-level API rate limiting during high-concurrency windows.

Changes:

  • Updates the DIFC proxy gh CLI smoke test in CI to call /rate_limit instead of /repos/{owner}/{repo} to avoid quota-based 403s.
  • Switches the live GitHub API integration test retry behavior to use the shared RATE_LIMIT_RETRY_CONFIG and increases the test timeout to accommodate longer backoff windows.
Show a summary per file
File Description
actions/setup/js/frontmatter_hash_github_api.test.cjs Uses shared rate-limit retry config for the live API integration test and increases per-test timeout to match the longer retry window.
.github/workflows/ci.yml Changes the DIFC proxy gh api check to use /rate_limit to reduce flakiness from installation token quota exhaustion.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +10 to +11
* Uses RATE_LIMIT_RETRY_CONFIG (5 retries, ~30 s initial delay) so that installation-level
* rate limit bursts during busy CI windows don't cause spurious test failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants