fix: run-tests timeout can cancel in-flight Test Runner jobs#1743
Conversation
Keep the Execute runGuid and call CancelTestRun when available so timeouts can stop EditMode jobs as well as Play Mode. Lookup uses Public|NonPublic once and caches misses so TF 2.0 IsRunActive(string) falls back to the bounded Play Mode exit path without retrying reflection. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reached
Next review available in: 5 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesTest cancellation flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Assert CancelTestRun and parameterless IsRunActive resolve against the installed Test Framework so Option A cannot silently degrade on this repo. Also mark the resolve cache flag volatile for double-checked locking clarity. Co-authored-by: Cursor <cursoragent@cursor.com>
|
LGTM (reviewer: Fable). Follow-up verified at 26869df: the EditMode test asserts the lookup resolves CancelTestRun(string) and parameterless IsRunActive() against the real TF 1.3.9 TestRunnerApi (so a future TF upgrade in this repo fails loudly instead of silently degrading), and _resolved is now volatile. The merge-gate device verification also passed: an intentional EditMode infinite-yield hang with --timeout-seconds 8 timed out with a message showing the CancelTestRun path succeeded, the immediate follow-up EditMode run passed without an Editor restart, and IsRunActive reported false afterward. Option A wiring is complete and version-compatible from TF 1.3.9 through the 2.0 previews. |
Summary
User Impact
CancelTestRun, uloop uses it with the run id fromExecute. IfIsRunActive()is missing (e.g. TF 2.0 guid overload), cancel still proceeds via the public Play Mode exit + capped wait without retrying reflection.Changes
Executerun GUID into cancel stop/restore.CancelTestRun(string)withPublic | NonPubliconce; cache success and failure.IsRunActive()only; miss → Option B fallback.Verification
dotnet test tests/RunTestsExecutionTimeout.UnitTests/RunTestsExecutionTimeout.UnitTests.csprojdist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)"(0 errors / 0 warnings)Made with Cursor