Skip to content

test(minimald): queue the trickle test's one-byte chunks up front - #2737

Merged
norrietaylor merged 1 commit into
mainfrom
fix/exec-trickle-reader-flake
Oct 29, 2026
Merged

norrietaylor merged 1 commit into
mainfrom
fix/exec-trickle-reader-flake

Conversation

@norrietaylor

@norrietaylor norrietaylor commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

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 on main (6 of 80 runs, measured on #2603), and more often on loaded CI runners. Today it failed every tests run 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_input counts 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.
  • The compiled test binary run alone, 40 times in a row: 40 of 40 passed, at 315–321 ms each.
  • The whole exec::tests module (all but end_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

  • Docs updated if behavior changed (no behaviour change; test only)
  • BREAKING CHANGE: footer present if this is a breaking change (not breaking)

Generated by Claude Code

Summary by CodeRabbit

  • Tests
    • Updated test coverage to verify that execution ends within the expected time when input continues arriving after the input limit is reached.

@norrietaylor
norrietaylor requested a review from a team as a code owner October 29, 2026 00:19
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 63bb8fcd-8fbe-45e5-9c0d-4137a3164fed
Commits

Reviewing files that changed from the base of the PR and between 436cfb9 and def6d6e.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 35294e84-5121-49a9-9c13-8adbdbff5a1b
Commits

Reviewing files that changed from the base of the PR and between 65d757d and 436cfb9.

Files selected for processing: 1
  • crates/minimald/src/exec/tests.rs

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

Walkthrough

The test now queues 100 one-byte messages after reaching the input bound. It retains the 50 ms reader cadence and checks that the exec ends with the input-held bound within five seconds.

Changes: Exec input-bound test

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: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

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: Passed 5
Check name Status Explanation
Title check Passed The title uses the required Conventional Commit format and clearly describes the main test change: queueing one-byte chunks up front.
Description check Passed The description includes complete Summary, Testing, and Checklist sections. It explains the flakiness, cause, fix, scope, issue reference, validation results, and non-breaking status.
Docstring Coverage Passed 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. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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.

@minimal-foundry

minimal-foundry Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Approved: no findings at def6d6ee93cd.

Nothing to do.

Clobber: none.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — No findings.

Panel: 2 of 3 personas ran (security, supply-chain); did not complete: correctness.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 29, 2026
@bryan-minimal

Copy link
Copy Markdown
Member

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 bryan-minimal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@norrietaylor
norrietaylor force-pushed the fix/exec-trickle-reader-flake branch from 436cfb9 to def6d6e Compare October 29, 2026 00:34
@CLAassistant

CLAassistant commented Oct 29, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — No findings.

Panel: 2 of 3 personas ran (correctness, supply-chain); did not complete: security.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants