Repository navigation
test(tui): raise dictation newline-trim test timeout from 5s to 30s - #179
KooshaPari wants to merge 1 commit into
Conversation
`dictation_command_trims_trailing_newlines` shells out to `sh -lc "printf 'hello from test\n'"` via `setsid` and gives the whole spawn a 5-second wall-clock budget. `printf` itself finishes in milliseconds, so the only thing that 5s can measure is how badly the scheduler is backed up. Observed in run 39698887862 / job 119562950996 (branch codex/kcode-version-delivery-gates-20261021) on a desk that was running load average 11-14 with concurrent cargo builds: ``` thread 'tui::app::dictation::tests::dictation_command_trims_trailing_newlines' panicked at crates/jcode-tui/src/tui/app/dictation.rs:526:14: dictation command should succeed: "timed out after 5s" test result: FAILED. 2516 passed; 1 failed; 19 ignored; 0 measured; 1 filtered out; finished in 62.99s ``` It failed in 2 of the last 3 desk-linux runs. `dictation.rs` is unchanged on master since 2026-10-16 (6cf71ed), so this is a pre-existing flake, not a regression from any recent PR. 30s keeps the assertion meaningful -- a hung shell still fails -- while stopping the test from being a load-average canary. The production `run_dictation_command(command, timeout_secs)` signature and every production call site are untouched; only the `#[cfg(test)]` budget moves. tx-agent: jcode tx-validated: none tx-scope: crates/jcode-tui/src/tui/app/dictation.rs tx-intent: Stop a pre-existing TUI flake that measures runner load, not dictation behavior
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
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 |
CodeAnt PR Risk: Low Risk
Assessed commit: |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by free · Input: 64.2K · Output: 4.9K · Cached: 95.4K |
|
Sibling PR #191 (branch |
User description
Closes #178
Observed failure
Run
39698887862/ job119562950996(branchcodex/kcode-version-delivery-gates-20261021):Root cause
The
5in the test is a timeout in seconds passed torun_dictation_command(command, timeout_secs):The test spawns
sh -lc "printf 'hello from test\n'"undersetsidand requires thewhole spawn to finish inside 5 seconds of wall clock.
printfcompletes inmilliseconds, so 5s does not measure dictation behavior -- it measures how
contended the runner's scheduler is. The desk was at load average 11-14 with
concurrent cargo builds when this failed, and it failed in 2 of the last 3
desk-linux runs.
Pre-existing flake, not a regression
crates/jcode-tui/src/tui/app/dictation.rsis unchanged onmastersince6cf71ed4e(2026-10-16). This is inherited frommaster, not introduced by arecent fix-forward PR.
The fix
run_dictation_command2nd arg, test only)5seconds30secondsWhy raise the budget instead of restructuring the test. The wall clock is not
intrinsic to the assertion -- it is a byproduct of using the production spawn
path (which
setsids a real shell) to drive it. Restructuring would mean eitherinjecting a fake spawn (which stops covering the real code path) or dropping
coverage. A 30s budget keeps the test exercising the production path end to end
and still fails on a genuinely hung shell, so the assertion stays meaningful.
30s is the smallest round jump that clears a load-average-14 scheduler stall with
margin, and it costs nothing when the test passes fast -- the budget is a ceiling,
not a sleep.
What deliberately did NOT change:
run_dictation_command's production signature and timeout semantics: untouched.#[cfg(test)] mod testsliteral moved.assert_eq!(text, "hello from test"): untouched.#[ignore]d or skipped. The CI gate still covers this behavior.Scope
crates/jcode-tui/src/tui/app/dictation.rsonly,#[cfg(test)]module only.8 insertions, 1 deletion. No workflow changes.
Validation
Compilation and the test itself are delegated to CI on this PR. Local cargo was
intentionally not run: the laptop had 20 GiB free (at the floor for a
jcode-tuitest build) and the desk compute node was unreachable (SSH bannertimeout on two attempts), so a cold local build risked filling the disk for a
one-literal change. CI builds this crate on every PR and will exercise the
jcode-tuilib test cohort, including this test.CodeAnt-AI Description
Allow dictation tests more time on busy runners
What Changed
Impact
✅ Fewer dictation test timeouts on busy runners✅ More reliable test results during concurrent builds✅ Hung shell commands still fail within 30 seconds💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.