Repository navigation
test(agents): render cancellation test waits longer and fails clearly - #12449
Merged
Merged
Conversation
Fix the test: raise an explicit RuntimeError if the wait loop times out instead of proceeding silently and canceling, which led to missing kills on a slow test runner. Failed 0 times tests/unit/agents/runtime/test_render.py . [100%] All checks passed! Success: no issues found in 155 source files Root cause: (a) was real. --- *PR created automatically by Jules for task [10737278039709828868](https://jules.google.com/task/10737278039709828868) started by @MarkusNeusinger* --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The change still has an incorrect hard-coded PR reference in the changelog fragment and leaves the timed-out render task running, risking leaked tasks and contaminated test runs.
2 open issues
What changed in this PR
This pull request improves the render-cancellation test’s resilience on slow CI runners by extending its startup wait and providing clearer timeout failures.
Changes:
- Extends the container-start wait from 10 to 25 seconds.
- Raises an explicit
RuntimeErrorwhen startup times out. - Adds a changelog fragment documenting the reliability improvement.
| File | Summary | Review comments |
|---|---|---|
tests/unit/agents/runtime/test_render.py |
Extends the startup wait and adds explicit timeout handling. | Moderate: Cancel and await the running task before raising the timeout to avoid pending-task/process warnings and test contamination. |
changelog.d/render-cancel-test-wait.md |
Documents the cancellation-test reliability improvement. | Nit: Remove the hard-coded (#12449) reference so the fragment contract can append the pull request number. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Copilot review of #12449: on the timeout path the render task and its fake containers were left to event-loop teardown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
test_local_backend_kills_the_container_on_cancellationwaited at most 10 s for both fake theme containers and then cancelled anyway. On a loaded CI runner that produced a misleading assertion (['r-cancelme-light'] == ['r-cancelme-dark', 'r-cancelme-light'], seen once on refactor(app): replace react-helmet-async with React 19 native metadata #12420). The wait is now 25 s (the fake containers live 30 s), and a timeout raises a clearRuntimeErrorinstead of falling through.feature/deterministic-cancel-test(test(agents): make the render cancellation test deterministic #12447). Its description says the root cause was the silent timeout; the race could not be reproduced locally, so this PR claims a clearer and more tolerant test, not a proven fix.agents/anyplot/render/backends/local.pyis unchanged (the parallel R-pilot session asked for that).Plan
N/A
Test plan
uv run pytest tests/unit/agents/runtime/test_render.py: passesruff check