Repository navigation
Conversation
test_concurrent_starts_are_single_flight bounded the first start, and the wait for it to enter launch preparation, with asyncio.wait_for(..., timeout=5). The first start's status write runs in a worker thread, so on a loaded Windows runner it outlived 5 s, wait_for cancelled the task, and the test failed with TimeoutError while proving nothing. Await the event and both tasks with kiro_crew.testing.wait.await_until, which bounds only a lost run and never cancels the awaited task. The same file's workflow-poll delete test had the same fixed bound on its poll task and gets the same wait. Fixes kirodotdev#23446 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
First Principles Review (Opus 5.5, fork) — ⏭️ skippedRevision |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a test-only change that swaps fixed 5 s [DESIGN-REVIEWED] 4f3ad58 Description read[DESCRIPTION-READ] 1d4ae7e02b854ecbd87a5165fc4b867b252caa187ef4b7431fe723e3139cd999 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 (fork) — ✅ no blocking findingsReviewed Review detailsThe diff matches the helper's types: No findings. [OPUS-REVIEWED] 4f3ad58 |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
Closing as superseded by #23376 (merged 2026-10-23 16:14 UTC). It makes the same This PR's red Backend Tests shards were caused by this PR, not a flake: |
Problem / Motivation
Goal:
test_concurrent_starts_are_single_flightno longer fails just because the first start's status write takes more than 5 s on a loaded runner.TestTransitionSerialization::test_concurrent_starts_are_single_flightfailed withTimeoutErroron Backend Tests (Windows) (8) for #20311, a PR that touches nothing in auto-research (#23446). The 5 sasyncio.wait_forat thefirstawait expired while the first start was still insideasyncio.to_thread(lifecycle.update_campaign_status, ...).Why it matters
A red on an unrelated PR costs its author a rerun, and on a fork that needs a maintainer. The test checks real ordering (the second start must wait for the first transition and get 409), but a slow runner decided the result, not that ordering.
Not a goal
auto_research/handlers.pyor to the transition lock. The production behaviour is correct; only the test's waits change.threading.Event.wait(5)calls in the same file. Those are thread-side waits inside a stubbed worker, not asyncio bounds on the task under test.What changed (motivation → approach → change)
TimeoutErrorfromasyncio.wait_for(first, timeout=5)whenupdate_campaign_statusruns longer than 5 s.wait_foralso cancels the awaited task when it expires, so the failure surfaces as aCancelledErrorinside the handler.entered,first,second) now usekiro_crew.testing.wait.await_until. That is the repo's replacement forasyncio.wait_for(signal, <short number>): it bounds only a lost run (half the test's timeout), never cancels the task, and names the signal on failure. The single-flight assertions are unchanged.TestDeleteIsFinal::test_a_workflow_poll_in_flight_cannot_resurrect_a_deleted_campaignawaited its poll task with the sameasyncio.wait_for(poll, timeout=5), and gets the same wait. After this change the file has noasyncio.wait_for(left.Backwards compatibility
Compatible: test-only change. No production code is touched.
Removes nothing: no test, assertion or case is removed; only the wait primitive changes.
Tests
update_campaign_statusdelayed bySLOW_STATUS_SECS=6). Cleanorigin/main(5f77c3f):1 failed ... TimeoutError. This branch:1 passed.test/test_auto_research_campaign_contract.py: 80 passed.test/test_flake_pattern_ratchet.py: 60 passed.Proof: not provable -- test-only change
Manual verification
N/A: test-only change. The reproduction above exercises the exact slow-runner condition from the issue.
Related Issues
Fixes #23446
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
🤖 Generated with Claude Code