Repository navigation
test(hosts): wait for the daemon's channel overflow instead of a fixed sleep - #367
Conversation
|
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 1 minute. View limit details
|
| Layer / File(s) | Summary |
|---|---|
Define dropped-output measurements lib/hosts/daemon.test.mjs, lib/hosts/daemon.ts |
The fake omp output uses shared flood and echo sizes. A helper waits for logged dropped-byte totals to reach a target. A comment notes that the test parses the overflow log. |
Use drop-aware waits lib/hosts/daemon.test.mjs |
Selected overflow tests wait for logged drop thresholds or the final flood line instead of fixed sleeps. The stalled-echo helper uses the logged drops when given a log; otherwise, it retains the timed wait. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Merge Risk: 
Low · previous review daa67
-
The synchronization changes have one bounded diagnostic issue: stalled overflow tests reach the test runner's timeout before reporting the helper's specific failure message. Aligning the deadlines is a small follow-up; no production behavior regression is established.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 75.00% which is insufficient. 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 4 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
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 by the test log,
Counting bytes as they fall.
No fixed nap to mark the overflow,
I wait for the measured call.
The last flood line arrives,
And I hop back to my burrow.
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything, but the diff since the last review is just the author applying the CodeRabbit suggestion verbatim — 📊 Overall: Like showing up to a surprise party and finding it already cleaned up — awkward, but I guess the work did itself. Files Reviewed (3 files)
Previous Review Summaries (2 snapshots, latest commit c1321b2)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit c1321b2)Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything, but the only diff since the last review is the author applying the CodeRabbit suggestion verbatim — 📊 Overall: Like showing up to a surprise party and finding it already cleaned up — awkward, but I guess the work did itself. Files Reviewed (1 file)
Previous review (commit daa6739)Verdict: No New Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything. 📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are. Files Reviewed (2 files)
Reviewed by free · Input: 357.1K · Output: 15.2K · Cached: 556K |
…d of a fixed sleep The daemon now logs each time it drops a channel's backlog on overflow. The overflow tests waited a fixed 1.5 s for the daemon to read a flood past the channel buffer; a slow runner missed that window, the uplink resumed before the overflow, and no resync followed.
…it for the last flood line
c1321b2 to
d7b02ca
Compare
Summary
The Windows CI run on #361 failed once in
lib/hosts/daemon.test.mjs: "output beyond the channel buffer while the uplink is down is dropped, then resync" timed out waiting for the resync. The overflow tests paused the uplink, then slept a fixed 1.5 s on the assumption that the daemon had read past the channel buffer by then. A slow runner had not, so no overflow and no resync followed.lib/hosts/daemon.ts: the daemon logs one line when it drops a channel's backlog:channel <ch>: dropped N bytes of output the server has not taken; resync. Each drop is a separate overflow of the 32 MiB channel buffer, so a flood logs at most a few lines. Only the channel id and a byte count are logged.lib/hosts/daemon.test.mjs: the overflow tests wait for that line, summing the dropped bytes against a threshold derived from the fixture's output size, instead of sleeping. The bytesAhead test also waits for the last flood line instead of a fixed 300 ms settle. The one test that expects no overflow keeps its sleep: nothing observable marks "the daemon has read everything" there, and a short stall there can only weaken its no-resync assertion, not fail it.Verification
bun test --timeout 30000 lib/hosts/daemon.test.mjs: 47/47, five runs in a row.taskset -c 0with four busy loops on that core): the old fixed sleeps failed 2 of 5 overflow tests, reproducing the CI failure; this version passes all six touched tests.Summary by CodeRabbit