Skip to content

Attempts to fix site-with-errors tests timing out#152

Closed
lindseywild wants to merge 5 commits intomainfrom
copilot/check-pr-failure-reason
Closed

Attempts to fix site-with-errors tests timing out#152
lindseywild wants to merge 5 commits intomainfrom
copilot/check-pr-failure-reason

Conversation

@lindseywild
Copy link
Contributor

No description provided.

Copilot AI and others added 4 commits March 9, 2026 16:47
Co-authored-by: lindseywild <35239154+lindseywild@users.noreply.github.com>
…to missing PRs

Co-authored-by: lindseywild <35239154+lindseywild@users.noreply.github.com>
Co-authored-by: lindseywild <35239154+lindseywild@users.noreply.github.com>
@lindseywild lindseywild marked this pull request as ready for review March 9, 2026 17:57
@lindseywild lindseywild requested a review from a team as a code owner March 9, 2026 17:57
Copy link
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

Adjusts test expectations and retry behavior to reduce flakiness/timeouts when validating cached results for the site-with-errors scenario.

Changes:

  • Make pullRequest optional in cached Result test typing.
  • Update site-with-errors test to avoid assuming every cached result contains a PR URL; only fetch PRs when present.
  • Increase default retry attempts in the fix GitHub Action retry helper.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/types.d.ts Makes Result.pullRequest optional to reflect real cache contents.
tests/site-with-errors.test.ts Stops unconditionally reading/fetching PR URLs; fetches PRs only when present and adds a PR-count assertion.
.github/actions/fix/src/retry.ts Raises default retry attempts for exponential-backoff retries.
Comments suppressed due to low confidence (1)

tests/site-with-errors.test.ts:150

  • The filter ensures pullRequest?.url exists, but TypeScript can’t narrow the type across this chain, so the code relies on pullRequest! non-null assertions. Consider using a type-predicate filter (or filtering on pullRequest itself) to eliminate the non-null assertions and keep the code type-safe if this logic changes later.
        results
          .filter(({pullRequest}) => !!pullRequest?.url)
          .map(async ({pullRequest}) => {
            const pullRequestUrl = pullRequest!.url
            const {owner, repo, pullNumber} =

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

export async function retry<T>(
fn: () => Promise<T | null | undefined> | T | null | undefined,
maxAttempts = 6,
maxAttempts = 10,
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

Increasing the default maxAttempts from 6 to 10 significantly increases worst-case retry time with the current exponential backoff (baseDelay 2s, capped at 30s), potentially adding multiple minutes of waiting and worsening timeouts in the action. Consider keeping the default smaller and/or passing a higher maxAttempts only at the call site(s) that need it, or making it configurable via input/env so retries don’t unexpectedly extend runtimes.

Suggested change
maxAttempts = 10,
maxAttempts = 6,

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lindseywild lindseywild closed this Mar 9, 2026
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