Skip to content

Port BrowserConnection.acquire and the relaunch waiter test (tester-army/e2e#1621) - #2040

Merged
kblok merged 2 commits into
mainfrom
fix/1997-browser-connection-acquire
Nov 21, 2026
Merged

kblok merged 2 commits into
mainfrom
fix/1997-browser-connection-acquire

Conversation

@kblok

@kblok kblok commented Nov 21, 2026

Copy link
Copy Markdown
Member

Adds a caching BrowserConnection.AcquireAsync / DisposeAsync to the local web launch path and ports upstream's relaunch-waiter test. A caller that joins a relaunch still in flight now goes through acquire once, and the Chromium sandbox option cannot flip between launches. Local launches in WebEngine now go through it.

Closes #1997

Upstream parity

Ported from tester-army/e2e packages/web/src/browser-connection.ts (BrowserConnection.acquire, dispose, registerSelectorEngines) and packages/web/tests/unit/chromium-sandbox.test.ts.

  • acquire: reuses a connected browser, relaunches a disconnected one, waiters join an in-flight launch and re-acquire if it failed.
  • dispose: closes the pending browser, best-effort.
  • registerSelectorEngines moved into BrowserConnection and runs inside acquire for a local launch.
  • Port-only: constructor takes the IPlaywright and an optional launch seam (the port owns its driver; .NET-only DI). LaunchLocalAsync is now internal because the engine's LaunchLocal seam defaults to it.

Upstream tests

All of the describe('BrowserConnection') tests are in tests/E2E.Tests/ChromiumSandbox/BrowserConnectionTests.cs, now run through AcquireAsync as upstream does:

  • launches chromium with the sandbox on / off when asked
  • keeps the sandbox on when a waiter joins a relaunch that is still in flight (new)
  • turns a sandbox launch failure into an error naming the option
  • passes any other launch failure through unchanged
  • does not pass the chromium-only option to firefox or webkit

Not ported

Checks

Real-model tests were not run (no Copilot login in this session). No public API change, so no docs update. Built on net10.0 only (the environment has no .NET 11).


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8c16d7c and 535371a.

Files selected for processing: 3

  • src/E2E/Engine/BrowserConnection.cs
  • src/E2E/Engine/WebEngine.cs
  • tests/E2E.Tests/ChromiumSandbox/BrowserConnectionTests.cs
  • 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.

Share

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e22a1bHfM5vdMpsWNAZ
@kblok
kblok merged commit 42ba4d4 into main Nov 21, 2026
5 checks passed
@kblok
kblok deleted the fix/1997-browser-connection-acquire branch November 21, 2026 18:45
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.

Port the BrowserConnection relaunch-with-sandbox waiter test (tester-army/e2e#1621)

2 participants