Skip to content

test: stop the reload-resend test racing its own injection timeout - #37354

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/37309-reload-resend-flake
Nov 14, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/37309-reload-resend-flake

Conversation

@JLargent42

@JLargent42 JLargent42 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Stop test_a_reload_inside_the_retry_onto_a_new_session_sends_the_full_completion from failing intermittently on loaded CI runners.

The test failed once on docs-only PR #37269 with AssertionError: assert ['sess-a', 'sess-a'] == ['sess-a', 'sess-a', 'sess-b']. The test patched the injection timeout to 1.0s. That one value ends attempt 1 and also bounds attempt 2, which does a session reset, a reload and two sends. On a slow runner attempt 2 timed out before the third send.

Why it matters

A random red on unrelated PRs (Backend Tests 3.12 shard 3) costs a rerun and trains reviewers to ignore reds.

Not a goal

  • No production change: _inject_with_retry and the injection loop behave correctly.
  • The sibling test test_a_timeout_after_a_reload_reads_the_session_that_received_the_completion keeps its real timeout, because it needs one to end attempt 1 and its attempt 2 is a single send.

What changed (motivation → approach → change)

Cause: one patched 1.0s timeout covers both attempts. Change: the first stream call raises asyncio.TimeoutError (what the real timeout produces) instead of hanging, and the injection timeout is patched to 30s. The attempt sequence and every assertion are unchanged. Only test/test_subagent_injection_channel_timeout_resend.py changes.

Backwards compatibility

Removes nothing: test-only change.

Tests

Before the change, slowing attempt 2 by 1.2s on main (a stand-in for a loaded runner) fails with the exact assertion from the issue. After it, the same slowdown passes, and all 6 tests in the file pass with pytest -n 0. check_comment_history.py passes against origin/main.

Proof: not provable -- test-only change

Manual verification

N/A — unit coverage sufficient; the change is the test.

Related Issues

Fixes #37309

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@JLargent42
JLargent42 requested review from a team and KiroCrewCaptain as code owners November 14, 2026 21:09
@JLargent42 JLargent42 self-assigned this Nov 14, 2026
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision b1d6a6c8a09e9367c1654e870b93f932029407d3 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision b1d6a6c8a09e9367c1654e870b93f932029407d3 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of b1d6a6c8a09e9367c1654e870b93f932029407d3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change only touches a test. It removes the shared 1.0s deadline that caused the flake, and the raised asyncio.TimeoutError hits the same except asyncio.TimeoutError branch in subagent_injection.py that a real timeout would hit.

[DESIGN-REVIEWED] b1d6a6c

Description read

[DESCRIPTION-READ] 721ebcba469eb7e5c13de03564477e4ab03502364054f16492072e202191c152

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed b1d6a6c8a09e9367c1654e870b93f932029407d3 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b1d6a6c

Verdict parsed from the review's SHA-scoped output markers for commit b1d6a6c8a09e9367c1654e870b93f932029407d3.

False positive or not applicable? A repository writer can comment:
/ai-review override fable b1d6a6c8a09e9367c1654e870b93f932029407d3 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of b1d6a6c8a09e9367c1654e870b93f932029407d3 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b1d6a6c

False positive or not applicable? A repository writer can comment:
/ai-review override gpt b1d6a6c8a09e9367c1654e870b93f932029407d3 false-positive: <reason, 20 to 500 characters>

@JLargent42
JLargent42 force-pushed the fix/37309-reload-resend-flake branch from 64dde93 to b1d6a6c Compare November 14, 2026 21:46
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 14, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 14, 2026 23:04

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tier 1 auto-approve: test (1 file). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: flaky-test fix confined to one test file; the first stream call raises its timeout instead of waiting it out, and the patched injection timeout uses the file's hang ceiling.

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.

Flaky: test_a_reload_inside_the_retry_onto_a_new_session_sends_the_full_completion misses the resend to the new session

2 participants