Skip to content

test(terminal): dispose foreground trackers between cases - #8552

Closed
bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:test/dispose-pane-foreground-trackers
Closed

bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:test/dispose-pane-foreground-trackers

Conversation

@bbingz

@bbingz bbingz commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

pty-connection.test.ts creates real pane foreground-agent trackers, but most cases do not retain and dispose the pane binding. Their delayed process reads can therefore settle after beforeEach replaces the shared store mock for the next case.

Exact-head CI for #8072 exposed the leak: a test that creates only tab-1/LEAF_1 received five clearAgentLaunchConfig calls, including two for tab-1/LEAF_2. The current test cannot create LEAF_2; those calls came from an earlier case's fixed 350/1200/6000 ms foreground-tracker ladder.

This fixture wraps the real tracker factory, records each tracker, and disposes all of them in afterEach before the next store mock is installed.

Testing

  • pty-connection.test.ts + pane-foreground-agent-tracker.test.ts: 457/457 passed.
  • pnpm run typecheck.
  • oxlint on the changed test.
  • oxfmt --check on the changed test.
  • git diff --check.

Evidence limitation

The exact CI failure is authoritative, but the leak did not reproduce locally under Node 26. The fix is based on the impossible cross-pane callback arguments and the tracker's deterministic delayed-read ladder; Node 24 PR Checks remain the final verifier.

Scope

Test fixture lifecycle only; no runtime behavior changes.

@bbingz

bbingz commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@bbingz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 6 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c2fdc91b-19b3-4122-8e10-bd36c72abfa0

📥 Commits

Reviewing files that changed from the base of the PR and between 0b65d72 and f36c36f.

📒 Files selected for processing (1)
  • src/renderer/src/components/terminal-pane/pty-connection.test.ts

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.

@coderabbitai

coderabbitai Bot commented Jul 13, 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.

@bbingz

bbingz commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #8551, which now contains both PTY test-lifecycle fixes in one non-conflicting test-infrastructure PR.

@bbingz bbingz closed this Jul 13, 2026
@bbingz
bbingz deleted the test/dispose-pane-foreground-trackers branch August 1, 2026 00:47
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