Repository navigation
test(ui): the blocked-stdin Stop test waits for the agent's stop job - #908
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Child-process exit polling crates/ui-egui/src/localagents.rs |
The test polls for up to five seconds for the child process to exit, instead of requiring immediate exit after finish_stops. |
Priority:
Estimated code review effort: 1 (Trivial) | ~4 minutes
Change: Other
Suggested reviewers: gpt-cmdr
Merge Risk: 
Minimal · up to b7026
-
The test-only change improves reliability without introducing merge-blocking risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title names the changed test and its new behavior, which matches the single-file test-only change: the blocked-stdin Stop test now waits for the agent's stop job. It is specific and conveys the primary change. The title is slightly loose on the mechanism (polling try_wait for up to 5 s after finish_stops), but it is related to the main change.
Full details: Description check
-
Explanation
The description follows the template's intent. The Summary section explains the flaky race, the cause (finish_stops takes the shared stop_jobs list via mem::take), and the fix (a test-only 5 s try_wait poll). The Testing section lists fmt and clippy runs and eight full test runs, with the unrelated connectiontree failures noted. The Related issue section is missing. It has no 'Closes #' or 'Part of #' reference, although the description cites PR
#907as the failing job. The author should add a related issue reference or state that none exists.
-
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
I’m a rabbit; I watch the clock,
Twenty milliseconds, tick by tick.
The child exits before the end,
I thump my paws and hop again.
Stop test waits, then rests its head.
Comment @coderabbitai help to get the list of available commands.
Code reviewThis PR changes only a test in I found no bugs, security issues or performance problems, and no AGENTS.md violations.
Nit, confidence low: the fixed 5 s deadline could be flaky on a heavily loaded CI runner. It is already generous, so I would leave it. Change sizeCompared: the whole PR against main (merge base 797ccab to PR head b7026de)
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. |
localagents::tests::stop_does_not_wait_for_a_blocked_stdin_writerfails now and then under the full parallel test run. For example, thetest / Test (ubuntu-latest)job of #907 failed atlocalagents.rs:662on a render-only change. Run on its own, the test always passes.Why. Dropping a
Runstops its agent on a background job whose handle goes into the process-widestop_jobs()list.finish_stops()takes the whole list (mem::take) and joins what it took. Other tests call it too: the descendants Stop test and everyThreadsdrop. When one of them takes the list just after this test's drop pushed its job, this test's ownfinish_stops()finds the list empty and returns at once. Thetry_wait().is_some()check then runs while the stop job is still in its 200 ms cancel wait, or still killing the process.Fix. Test only. After
finish_stops(), the test pollstry_waitfor up to 5 s, as the neighbouring descendants test already does for its descendant. An agent that is never stopped still fails it. Product code is unchanged.Not done here: making
finish_stopsitself wait for jobs another caller took, for example with a pending count and aCondvar. In the app only oneThreadscalls it, at shutdown, so the race doesn't arise there.fmt and clippy (
-D warnings) pass.cargo test -p rustgis-ui-egui --libran 8 times in full: the test passed every time, and the only failures were threeconnectiontreedownload tests that also fail on main on this machine.Summary by CodeRabbit