Repository navigation
test: stop the reload-resend test racing its own injection timeout - #37354
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of 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 [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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
64dde93 to
b1d6a6c
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
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.
…irodotdev#37354) (cherry picked from commit 18aba3e)
Problem / Motivation
Goal: Stop
test_a_reload_inside_the_retry_onto_a_new_session_sends_the_full_completionfrom 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
_inject_with_retryand the injection loop behave correctly.test_a_timeout_after_a_reload_reads_the_session_that_received_the_completionkeeps 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. Onlytest/test_subagent_injection_channel_timeout_resend.pychanges.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.pypasses 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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.