Skip to content

Fix request-order flake in GitHub PR batching tests - #6471

Merged
ymichael merged 1 commit into
mainfrom
bb/fix-graphql-batch-fixture-order
Oct 28, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fix-graphql-batch-fixture-order

Conversation

@ymichael

@ymichael ymichael commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The GitHub PR batching tests returned canned GraphQL data for aliases p0/p1, assuming credential-file reads always completed in request order. They can complete in either order. When PR 2 is enqueued first, the fake incorrectly attaches PR 1's success to p0 and its error to PR 1's actual alias p1. This produced the expected found, got unavailable failure in CI 40688135091.

What changed

The fake gh command now supports responses keyed by PR URL and uses the aliases in the actual GraphQL document. URL-batching fixtures use this mode; existing fixed responses remain for other test scenarios. The partial-error test runs with both request orders, and the 26-PR cap test verifies every returned PR number, including the second document.

Only tests and their fake-gh helper change. Production batching, credential handling, deadlines and retry behavior are unchanged. The existing direct API, real subprocess boundary, deduplication and batch-count assertions remain.

How you verified

  • A temporary test-boundary diagnostic held the first real credential-file read until the second completed. The original test failed with the exact CI assertion; the recorded query had PR 2 at p0 and PR 1 at p1. The same diagnostic passes after this change for both request orders. Diagnostic instrumentation was removed afterward.
  • pnpm exec turbo run test --filter=bb-plugin-bb--github-pr-status: 180 tests pass across all 10 files.
  • pnpm exec turbo run lint typecheck --filter=bb-plugin-bb--github-pr-status: passes, zero lint warnings/errors.
  • CI 40760326688 passed at final head 3743b49573, including the Windows plugin shard, without a rerun.
  • Independent diff review found no correctness issues. No timeouts increased, retries added, assertions removed or production changes made.

This fixes the observed alias-order fixture defect; it does not claim to resolve the separate profiler worker exits or Windows load-related timeouts found during the flake sweep.

AGENT GENERATED

@ymichael
ymichael merged commit 654aa76 into main Oct 28, 2026
49 checks passed
@ymichael
ymichael deleted the bb/fix-graphql-batch-fixture-order branch October 28, 2026 20:19
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.

1 participant