test: isolate blocking console render workers - #5162
Conversation
Keep thread-pool continuations available for scheduler regressions in #5106.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughConcurrency-sensitive console tests now run blocking workers on dedicated long-running threads. Tests create workers before awaiting synchronization signals, and selected cleanup scopes now include those awaits. ChangesConsole concurrency test scheduling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk: ⚪ Minimal · up to The test-only scheduling changes have no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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. A rabbit starts a worker thread Comment |
Code reviewReviewed the diff in Summary: This is a targeted, well-reasoned test-reliability fix with two independent improvements, both correctly applied consistently across all affected tests:
Checked for consistency: all 8 This is test-only code (no production/library changes), scoped correctly to the core No outstanding findings from CodeRabbit/Codex bots at review time (both were still running with no posted issues), so nothing to cross-check as addressed. No issues found. Nice fix — the try/finally reordering in particular closes a real resource-leak window that could itself have been feeding the flakiness under investigation. |
|
CodeRabbit reports no actionable findings. Its docstring-coverage warning counts existing regression methods and the two private worker helpers. The helpers include the non-obvious threading rationale, and named tests follow the existing test-project convention without repetitive XML summaries. No public API documentation changes are needed. |
Problem and change
Linux CI on #5160 failed while waiting for a dependent module in
RunSchedulerAsync_QueuesDependentWhenDependencyCompletes, matching the starvation symptoms tracked in #5106. Console output tests had eightTask.Runworkers that deliberately blocked on synchronous render gates, occupying workers needed by their own cleanup continuations and concurrent scheduler tests.Run those blocking workers on dedicated threads using
TaskCreationOptions.LongRunning; unwrap asynchronous flush tasks so failures remain observable. Move acquisition waits inside existingtry/finallycleanup blocks so a failed wait still releases its worker. Scheduler implementation, assertions, and test timeouts remain unchanged.Validation
Flush_CancellationInterruptsRenderGateWaitalone stalled with the portable thread pool limited to one worker. The 45-second agent guard terminated it with zero tests completed.Related to #5106 and #5160. The controlled reproduction establishes a starvation source; subsequent full Linux CI must confirm that the observed scheduler timeout is resolved before closing #5106.
Summary by CodeRabbit