Repository navigation
test(decisions): import the HTTP stack before the end-to-end Jev ask - #29458
Conversation
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: a test-only change that moves the cold Notes
[DESIGN-REVIEWED] c8db444 Description read[DESCRIPTION-READ] 2038f2cac423abd87790ede55fa31276349cbabc6b35f03ce4123f14497cdc45 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: |
Since #26950 the provider imports httpx, and through it httpcore and h2, inside the gate's 2 s budget. The first import in a fresh CI worker can use the whole budget, so the gate cancels the call before the POST and the asked cases see no request. An autouse fixture now imports h2, httpcore and httpx before the timed ask.
3a26487 to
c8db444
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (1 files). 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: end-to-end decisions test imports the HTTP stack before the timed ask.
Problem / Motivation
Goal: Make
test_jev_response_reaches_the_assembled_messagepass on slow CI runners again.Since #26950 merged, the three cases of this test that expect one judge request fail on Linux shards with
assert 0 == 1attest/test_decisions_end_to_end.py:130. The loopback judge gets no request. The failure occurred on shard 5 of PR #14767 two times in a row, and on PR run 41762567848 from another branch. Neither branch changes Python code.Why it matters
Any PR whose shard 5 gets this file can go red without a cause in its own diff. Each red costs a rerun and a CI slot, and a second failure blocks the PR until main changes.
Not a goal
What changed (motivation → approach → change)
The test asks the gate for a decision with
timeout_ms=2000, and the gate wraps the whole provider call in that budget. Since #26950 the provider importshttpxwith HTTP/2 inside that call, andhttpximportshttpcoreand theh2modules when it builds the client. In a CI worker, this is the first import of these packages. The modules have no bytecode yet, and coverage traces them, so the import can use the whole 2 s budget. The gate then cancels the call before the POST, and the test sees no request.A new autouse fixture imports
h2,httpcoreandhttpxbefore the test starts. The cold import then runs outside the timed call, and the 2 s budget only covers the client build and the loopback request. I did not raise the budget, because a larger budget only moves the race to a slower runner.Backwards compatibility
Compatible: the diff adds one test fixture and changes no product code.
Removes nothing: the test keeps its cases, assertions and budget.
Tests
test/test_decisions_end_to_end.pykeeps its five cases, their assertions and the 2 s budget. The new fixture only moves the first import ofh2,httpcoreandhttpxout of the timed call.Proof: not provable -- test-only change
Manual verification
I reproduced the CI failure locally on
origin/main. I installedhttpx[http2]==0.28.1withpip install --no-compileand setPYTHONDONTWRITEBYTECODE=1. Then I ran the file withtaskset -c 0,1,-n4,--cov=kiro_crewand--cov-branch. Without the fixture, 2 of 3 runs failed with the CI assertion. With the fixture, 5 of 5 runs passed on this branch.Related Issues
The failure is the same assertion as closed #17324, which reported it on Windows before #26950.
Sibling sweep
Swept: git grep -l -E "TestServer|make_url" -- 'test/test_decisions*.py' | xargs grep -n "timeout_ms="
Sibling: test/test_decisions_end_to_end.py -- changed here
Sibling: test/test_decisions_impl_jev.py -- not affected -- it calls the provider directly, and the httpx import and client setup run before asyncio.timeout starts
Pattern harvest
Not generalizable: one test sent a real request through the gate while the provider's first import ran inside the budget, and the sweep found no second site.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Fixes #29457