Skip to content

[CI] test: remove idle polling from compaction contracts - #26373

Merged
nwparker merged 1 commit into
mainfrom
nwparker/structured-compaction-positive-polls
Oct 8, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/structured-compaction-positive-polls

Conversation

@nwparker

@nwparker nwparker commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​24 $\color{#cf222e}{\Huge{\mathbf{−}}}$​24 0
Prod 0 0 0 0

ELI5

The compaction tests spend repeated 50ms gaps waiting for positive results that are already available. Check those same results every 1ms so successful tests finish sooner.

What Changed

Add { interval: 1 } to 24 existing synchronous vi.waitFor assertions in structured-conversation-compaction.test.ts. All 21 cases, callbacks, assertions and default 1,000ms deadlines remain. Asynchronous journal waits, child-exit checks, fake clocks and the real 20/50ms quiet windows retain their original behavior.

Why

Use the existing polling API to remove idle time while retaining real asynchronous work and failure detection. Shorter deadlines, fewer cases or replacing the real clock would weaken these contracts. More frequent polling can use additional CPU when the expected result does not arrive.

Linked Issue

Related measured test-suite improvements: #26327 and #26360.

Visual Proof

N/A — test polling only; no visual or interaction change.

Testing

Correctness run 37699229724 passed all eight original/candidate commands under Bun 1.4.2 and actual Node 24.21.0 with shuffle seeds 104729 and 130363. Every command retained all 21 original case identities and passed them without skips. Original source, runtime routes, four workers, isolation, six setup files, errors and normal process exit were checked independently.

Timing run 37705183920 retained every whole pnpm test command in before/after, after/before, before/after order:

Pair Before After Less time
1 6.972627752s 5.869026323s 15.83%
2 7.112682717s 6.082440252s 14.48%
3 7.007252394s 5.929391449s 15.38%
Mean 7.030854288s 5.960286008s 15.23%

All three pairs improve, including the first commands. This is 1.18× faster for this fixture with 21 cases. There was no warmup, retry or discarded sample. All six commands passed the same original cases with four workers, isolation, six setup files and disabled Vitest filesystem module cache. The held Linux ARM host used Vitest 5.0.3 and the pinned runtimes above. Shared OS and Bun transpiler caches can still warm between counted commands.

The measurements use frozen source 31a5b42. The product fixture before/after bytes match that source exactly on base 5a1009f. Root and an independent reviewer replayed the collector, all six raw case/status maps, settings, process evidence and arithmetic. This single-file result does not establish the overall 2× full-suite goal.

Earlier timing attempt 37702809683 failed before launching any timed command because its admission record used a string run ID where the validator required a number. That failed attempt and its raw artifact remain retained; the corrected definition changes only the admission ID type. No failed timing sample was replaced or discarded.

  • Existing cases, assertions, work and deadlines retained; no mirrored test added.
  • Local oxfmt --check, changed-code checks and Node typecheck passed; no native or Electron test launched locally.
  • Fresh shipping-head CI: all ten unit shards and other applicable checks passed.

Review

Independent source, all-eight correctness and all-six raw timing reviews passed. Root removed the 24 new polling options and recovered the entire original module byte for byte. All current-head checks passed or were explicitly skipped by scope. CodeRabbit reviewed this head and reported no actionable comments; there are no unresolved review threads.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied.

Notes

No production behavior, process termination, SSH execution, remote protocol or workspace/platform routing changes. Native/runtime contracts remain under actual Node where configured and covered by CI.

Checklist

  • Focused change; before/after measurements, mechanism and alternatives explained.
  • N/A visual proof explained; original tests retained.
  • Self-reviewed and independently checked; cross-platform and SSH considered.
  • Full CI and actionable review disposition complete.

Final merge boundary

Current-head CI qualifies eeaf0cafd6edc21b6292aebc2489fb6b7a98a97b. Main was 65a0e9620ee05143642332e10bfc3a43c6b212f0 at the final source check, which is later than the candidate base 5a1009f82fa1e1ae5e33e5ff965885fadc00415e; the compaction fixture still matches the measured before bytes exactly. Other upstream changes were not covered by the candidate CI. Merged at 369b202b0168bc772e9405c0108e062d5e137712 with actual parent 65a0e9620ee05143642332e10bfc3a43c6b212f0. The actual squash changes only this test file, and both parent/candidate fixture hashes match the measured before/after bytes exactly. The actual parent differs from the candidate base, so the candidate CI does not qualify the additional upstream changes.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 84920635-e8b4-4c57-a0b9-e885025404c0
📥 Commits

Reviewing files that changed from the base of the PR and between 4f60f32 and eeaf0ca.

📒 Files selected for processing (1)
  • src/main/native-chat/agent-session-wire/structured-conversation-compaction.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The compaction tests now pass { interval: 1 } to vi.waitFor when checking adapter calls, message dispatches, and other asynchronous outcomes. The assertions and expected outcomes are unchanged.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to eeaf0

This change only adjusts polling frequency in the compaction tests; no specific merge risk is evident.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Title check ✅ Passed The title clearly identifies the main change: removing idle polling from compaction contract tests.
Description check ✅ Passed The description is complete and focused. It explains the change, reason, testing, measured impact, visual proof, review status, scope, and checklist items. The linked issues use “Related” rather than …
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 369b202 into main Oct 8, 2026
37 checks passed
@nwparker nwparker changed the title test: remove idle polling from compaction contracts [CI] test: remove idle polling from compaction contracts Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant