Repository navigation
test(minimald): queue the trickle test's one-byte chunks up front - #2737
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Queue input after reaching the bound crates/minimald/src/exec/tests.rs |
The test replaces a timed feeder task with 100 immediately queued one-byte messages. It retains the slow reader and timeout assertion, and removes the feeder abort. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related PRs
- gominimal/minimal#2197: This PR introduced the input queue and bound behavior that the test covers.
- gominimal/minimal#2625: This PR added the test that this change updates.
Suggested reviewers: bryan-minimal, minimal-foundry
Merge Risk: 
Minimal · previous review 436cf
-
This test-only change is ready to merge; no actionable risk was identified.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
A rabbit queues the bytes in a row
No timed feeder makes them flow
One byte comes through each fifty ticks
The bound still tests its steady tricks
The exec ends before five seconds go
Comment @coderabbitai help to get the list of available commands.
|
Approved: no findings at Nothing to do. Clobber: none. |
|
Thanks for taking this, Norrie, and sorry for the flake: it came in with #2625. Your reading of the pump matches mine. The stall timer is armed only while a chunk is refused, and a refusal needs a chunk already queued behind the cap; a feeder on the reader's own period left that to scheduler phase. I tried the product-side alternative on anvil first (keep the timer running between chunks while a wait is open) and dropped it: it would end an exec whose chunks all fit and which parks nothing on the channel, which is not what the window is for. Queueing the chunks ahead pins the case the test exists for, so test-only is the right scope. On our side: anvil's prepush mirror now repeats every new or changed test fifteen times on two cores with a busy neighbour before we call a branch ready, so a one-in-twelve timing test does not get through on a single green run again. |
bryan-minimal
left a comment
There was a problem hiding this comment.
Diagnosis confirmed on anvil; test-only is the right scope.
a_trickle_reader_fed_one_byte_chunks_is_still_ended raced a 50 ms feeder against a 50 ms reader. Time at the input bound only accrues while chunks queue behind the cap, which happened only when the feeder ran ahead, so the exec was ended late or not before the 5 s timeout. It failed about one run in twelve on main and more often on loaded runners. Queue a hundred one-byte chunks behind the cap before the reader starts. Each read lets one in and the next is refused at once, the case the test pins: the wait at the bound must span chunks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J3Guwr3mQPqSeGMcjzVjTd
436cfb9 to
def6d6e
Compare
Summary
exec::tests::a_trickle_reader_fed_one_byte_chunks_is_still_ended, added in #2625, flakes. It times out at 5 s about one run in twelve onmain(6 of 80 runs, measured on #2603), and more often on loaded CI runners. Today it failed everytestsrun I checked on #2603's merge-queue runs, #2720 and #2723.Cause. The test raced a feeder that sent one byte every 50 ms against a reader that read one byte every 50 ms.
pump_channel_inputcounts time at the input bound only while a chunk is refused at the cap. A chunk is refused only when one is already queued behind the cap, which happened only when the feeder ran ahead of the reader. With equal periods, that came down to scheduler jitter: the test passed in about 0.5 s when the feeder won and ran past its 5 s timeout when it didn't.Fix. Queue a hundred one-byte chunks behind the cap before the reader starts, and drop the timed feeder. Each read now lets one chunk in, and the next is refused at once. That is the case the test pins: the wait at the bound must span chunks. The exec is now ended after one 300 ms stall window every run. No product code changes.
Refs: #2625
Testing
just test-one a_trickle_reader_fed_one_byte_chunks_is_still_ended -p minimald: PASS in 0.316 s.exec::testsmodule (all butend_to_end), four copies at once on four cores, five rounds: 20 of 20 runs passed, 49 of 49 tests each.cargo fmt -p minimald -- --check: clean.Checklist
BREAKING CHANGE:footer present if this is a breaking change (not breaking)Generated by Claude Code
Summary by CodeRabbit