Skip to content

test(agents): render cancellation test waits longer and fails clearly - #12449

Merged
MarkusNeusinger merged 5 commits into
mainfrom
feature/deterministic-cancel-test
Oct 29, 2026
Merged

MarkusNeusinger merged 5 commits into
mainfrom
feature/deterministic-cancel-test

Conversation

@MarkusNeusinger

Copy link
Copy Markdown
Owner

Summary

  • test_local_backend_kills_the_container_on_cancellation waited 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 clear RuntimeError instead of falling through.
  • Written by Google Jules on 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.py is unchanged (the parallel R-pilot session asked for that).

Plan

N/A

Test plan

  • uv run pytest tests/unit/agents/runtime/test_render.py: passes
  • ruff check
  • Diff under 20 lines: no Flash pre-PR check (CLAUDE.md delegation rule)

MarkusNeusinger and others added 3 commits October 29, 2026 11:22
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>
Copilot AI lite review requested due to automatic review settings October 29, 2026 13:34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 RuntimeError when 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

Comment thread changelog.d/render-cancel-test-wait.md Resolved
@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

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>
@MarkusNeusinger
MarkusNeusinger merged commit 0d4956c into main Oct 29, 2026
18 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the feature/deterministic-cancel-test branch October 29, 2026 21:15
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.

2 participants