Skip to content

[CI] perf(tests): release stale pane migration listeners between cases - #26131

Merged
nwparker merged 1 commit into
mainfrom
nwparker/persistence-pane-hook-cleanup
Oct 7, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/persistence-pane-hook-cleanup

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

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

ELI5

The pane-identity migration suite spent time updating a Store from a previous test after that Store had closed. Cleaning up that listener between tests makes the same seven cases 54.94% less time in matched runs: 13.126 → 5.915 seconds.

What Changed

Stop the existing canonical hook server at the start of the suite's existing afterEach, then keep the original awaited Store close and directory removal. The server flushes pending status while the directory and SQLite authority exist, removes its alias persistence listener and clears its aliases. It does not publish an empty alias list into the Store.

Why

Earlier cases leave an alias listener attached to a frozen Store. The following 130,000-leaf case registers aliases through that stale listener, repeatedly rebuilding alias snapshots before frozen-write handling rejects the save. Ending the listener's lifetime removes that work. The first three cases already stop the same server themselves; the additional cleanup is idempotent. Every case body, assertion, leaf and same-case reload remains unchanged. This fixes fixture cleanup instead of reducing the workload or replacing SQLite.

Linked Issue

Maintainer-requested test performance work. Based on main after #26111; its independent fixture-reuse result is not combined with this one.

Visual Proof

N/A — test cleanup only; no product UI or interaction change.

Testing

Frozen source 6d90d51802ddacbbcddaf4af6eeee85972b23789; only the two-line test cleanup patch differs between arms. Whole pnpm test time, one physical file / seven original named cases, actual Node runtime pool, four-worker cap, cache explicitly disabled, existing six setup files, flags, isolation and deadlines. Three pairs alternate order; every qualified sample is included.

On October 7, 2026, the two-line cleanup was moved onto main 385fe8ab4eeed0ae819376bac59265f3945004fb after its parent PR merged. The migration fixture before applying the patch exactly matches the original measured source, and the patched fixture is byte-identical to the measured candidate 44b410880857bf59daa1b4c2513bdcee506a6ca7. The base update includes 21 other changed paths outside this measured cohort. The table remains the three matched pairs on frozen 6d90d51802ddacbbcddaf4af6eeee85972b23789; fresh CI qualifies the aligned source separately and does not establish another performance result.

Pair Before After Time reduction
1 13.954 s 5.413 s 61.21%
2 12.962 s 6.762 s 47.83%
3 12.463 s 5.569 s 55.32%
Mean 13.126 s 5.915 s 54.94%

All seven original cases pass with exact case/status/runtime-route parity and unchanged source within every invocation. AST/source proof preserves the seven test bodies, 13 assertion calls, 130,000 leaves and all same-case reloads byte-for-byte. Two invocations failed the preset external-coordinator guard; their raw artifacts are retained separately and only those invalid samples were repeated. No test or assertion failure was excluded.

  • Three files / 17 cases pass shuffled seeds 104729 and 130363 under both Bun's coordinator and stock Node: four runs with exact named-case/status parity. Includes cross-host pane identity and layout-binding recovery regressions.
  • Actual Node routing, file isolation, six setup files and existing child flags remain enabled.
  • pnpm tc:node, changed-code quality and formatting pass locally on macOS with background launches.
  • Independent review confirms pending status flush precedes authority closure; no same-case write or authority contract changes.
  • Existing tests qualify this cleanup; no duplicate mirror test added.
  • Final aligned head a1da44e6d0c30ef6442dc1eef61106c881cf97f6: all required CI gates pass; current-head CodeRabbit review has no actionable comments and no unresolved threads.
  • Actual five-shard CI checkout 96188c64f8425ce770c43f075b72c2290d446a3c reports all 11,408 selected physical files exactly once: 11,273 passed, 135 existing skips, zero failed files and zero unhandled errors. The full selection equals incoming main; runtime routing and six setups are preserved by source. CI timing artifacts do not contain per-case identities, so these counts are physical files.

The 2.22× result is for this suite, not the complete suite or CI wall time. The requested whole-suite 2× target remains unmet. Linux is qualified by PR CI; Windows is not locally measured.

Review

No production code, persistence format, execution-host ownership or remote protocol change. The existing canonical singleton remains the owner; this only ends its fixture lifetime before removing that fixture's data.

Agent skill upstream boundary

  • Not applicable; no upstream skill content copied.

Checklist

  • Small change with behavior, mechanism, alternative choice and before/after measurements explained.
  • N/A visual proof explained above.
  • Self-reviewed and independently reviewed for correctness, resource cleanup and performance.
  • Cross-platform, folder workspace and SSH/host identity behavior considered; original regressions retained.
  • CI checks pass; local relevant checks above passed.

@nwparker
nwparker changed the base branch from nwparker/persistence-import-reuse-current to main October 7, 2026 08:09
@coderabbitai

coderabbitai Bot commented Oct 7, 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: 40663902-d43c-4876-adc0-901aa5f8c7c6
📥 Commits

Reviewing files that changed from the base of the PR and between 385fe8a and a1da44e.

📒 Files selected for processing (1)
  • src/main/persistence-pane-identity-migration.test.ts

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


📝 Walkthrough

Walkthrough

The persistence identity migration test imports agentHookServer and stops it in the shared afterEach cleanup before closing stores and removing the temporary directory.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to a1da4

This test cleanup stops the shared hook server before closing stores and removing temporary state. No actionable merge-blocking risk is established.

🚥 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 describes the main change: releasing stale pane migration listeners between test cases.
Description check ✅ Passed The description covers the change, reason, testing, performance results, visual-proof exemption, and checklist. It explains that no issue is linked because this is maintainer-requested work, consisten…
✨ 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 force-pushed the nwparker/persistence-pane-hook-cleanup branch from 44b4108 to a1da44e Compare October 7, 2026 08:13
@nwparker

nwparker commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nwparker
nwparker merged commit 6fd0918 into main Oct 7, 2026
30 checks passed
@nwparker nwparker changed the title perf(tests): release stale pane migration listeners between cases [CI] perf(tests): release stale pane migration listeners between cases 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