test(tui): de-flake cleanup-session summary toast assertion#248
Conversation
The cleanup worker marshals its 'removed N session(s)' summary toast AFTER the 'unverifiable engine pid' warning (app.py _cleanup_sessions_worker), each via a separate call_from_thread hop. Both cleanup tests waited `until` the earlier pid warning appeared, then did a BARE assert on the later summary — so on slow Windows timing the summary had not reached the message pump yet, and the assert raced it. Surfaced as a py3.11 Windows-only failure of test_cleanup_sessions_mux_error_notifies on the v0.9.0 merge commit, where the identical tree had passed in the PR's own CI. Wrap the summary check in the same `until` poll the surrounding waits use.
|
Warning Review limit reached
Next review available in: 8 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: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
Follow-up to the 0.9.0 release (#247). De-flakes a Windows-only CI failure — not a code regression; v0.9.0 shipped fine.
The failure
On the #247 merge commit,
test (windows, py3.11)failed:The identical tree passed this exact job in the PR's own CI — same code, passed once / failed once = a timing flake.
Root cause
_cleanup_sessions_worker(app.py) marshals two toasts from the worker thread via separatecall_from_threadhops, in this order: theunverifiable engine pidwarning, then theremoved N session(s)summary. Both cleanup tests waiteduntilthe earlier warning appeared, then did a bareasserton the later summary — so on slow Windows timing the summary toast hadn't reached the message pump yet and the assert raced it.Fix
Wrap the summary check in the same
until()poll the surrounding waits already use, in bothtest_cleanup_unknown_sessions_notifiesandtest_cleanup_sessions_mux_error_notifies. Test-only; no production code touched.Verification
pytest tests/test_tui_app.py -k cleanup→ 2 passed locally.