Skip to content

fix(chromium): disable TCP port randomization on Windows - #43605

Merged
Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dcrousso:fix-43545
Oct 25, 2026
Merged

Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dcrousso:fix-43545

Conversation

@dcrousso

Copy link
Copy Markdown
Contributor

randomized TCP port allocation can fail with WSAENOBUFS on Windows even when ports are available

disable TcpPortRandomizationWin in the existing default feature list to avoid intermittent ERR_NO_BUFFER_SPACE failures

fixes #43545

randomized TCP port allocation can fail with `WSAENOBUFS` on Windows even when ports are available

disable `TcpPortRandomizationWin` in the existing default feature list to avoid intermittent `ERR_NO_BUFFER_SPACE` failures
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

23556 passed, 701 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

5189 passed, 614 skipped


Merge workflow run.

@dgozman
Dmitry Gozman (dgozman) merged commit 97b3fd7 into microsoft:main Oct 25, 2026
24 checks passed
@dcrousso
Devin Rousso (dcrousso) deleted the fix-43545 branch October 26, 2026 15:15
Lukas Jost (lusu007) added a commit to groundsgg/library-motd that referenced this pull request Oct 26, 2026
Windows Chromium intermittently fails loopback module requests with
`ERR_NO_BUFFER_SPACE` before the editor fixture initializes. Apply the
test-browser mitigation from [Playwright
#43605](microsoft/playwright#43605) until a
stable release includes it: disable `TcpPortRandomizationWin` on
Windows. Preserve Playwright 1.64.1's complete disabled-feature list in
one argument, retain custom executable handling and leave other
platforms unchanged. This changes no library code or OS setting.

A real CDP check compares effective switches against an unmodified
launch, explicitly overriding inherited worker defaults. It verifies
preservation of every default feature and other switch, with exactly one
disabled-feature argument. Windows option inheritance is exercised on
Linux too. Remove the temporary helper when adopting the stable upstream
fix.

Validation: all required CI checks pass, including 1,211 Linux browser
cases (16 intentional platform/engine skips), Windows rendering, packed
Node/DOM/React consumers, example builds and Node 22/24. Local
command-line regressions were verified red/green; native Windows Chrome
also retained the effective defaults and initialized the real editor.
Independent review found no remaining issues. No existing rendering
assertion is weakened or retried. The upstream report matches our
failure class; the mitigation does not establish the exact cause of
every previous resource failure.

Refs #89.
maksii added a commit to maksii/paqvilo that referenced this pull request Oct 29, 2026
Finalizes the 0.9.8 test audit from `origin/0.9.8` `adf1b72c`, and makes
the suites independent of host speed.

## What changes?

- **Fixture lifecycle:** canonical temporary roots, owned cleanup,
controlled protocol and clock gates, and explicit local-application
readiness close the remaining audit findings. Product fixes keep picker
generation ownership, source feedback across redraws and OOPIF document
readiness, each with regressions.
- **Runner coverage:** browser CI covers Linux Chromium, Windows
Chromium and Windows Edge. Applicable Mirage and shared changes run the
complete SDK client and storage-volume gates on Windows and Linux,
including the pinned Python client and the public WebAPI sample (`npm
run ci:sdk:prepare`, `npm run ci:sdk`). ServiceClient's compatible
Pkcs/Xml patches clear its NuGet advisories while keeping
Dataverse.Client 1.2.27; required SDK verification audits the locked
dependency inventory and fails closed.
- **Windows loopback browsers:** owned Lense and Mirage launches disable
`TcpPortRandomizationWin` on Windows (backport of
microsoft/playwright#43605), avoiding `net::ERR_NO_BUFFER_SPACE` on busy
loopback sessions. Tests that launch Playwright directly get the same
options through the test bootstrap, which verifies the copied defaults
against the pinned Playwright.
- **No speed metrics in tests:** waits, actions and requests expected to
succeed keep only hang guards; every suite's runner applies
`--test-timeout` (180 s units, 300 s browsers). A test that asserts a
deadline applies it to the asserted step alone: `runAcceptance` steps
accept their own `timeout`, and `verifyParity` takes `readinessTimeout`
for its post-load readiness waits. Wall-clock upper bounds give way to
the reported outcome.
- **Repository hygiene:** audit reports (including the earlier
`test/audit/` record) and audit-only benchmark scripts are kept in
ignored local storage, not the repository. Shipped examples no longer
import the test-only fixture helper.

## Review

Code and functional review found and fixed: the test-only browser
backport masking product launches, examples importing a test helper, the
native provider install/query race with the live inspector (reproduced
by injecting the inspector's reinstall), status-poll notices treated as
start failures, and the deadline-sharing class above. Every original
functional assertion and lane remains.

## Validation

- Fresh full pre-push validation on the pushed head: every suite, SDK
gates and package smoke.
- Hosted CI, Security, all main CodeQL configurations and `npm run
check:pr -- --pr 30` are verified on the pushed head before merging.

- [x] My PR title follows Conventional Commits.
- [x] I used synthetic fixtures and kept portal exports, credentials and
live evidence out of this repository.
- [x] I updated coverage/docs for changed platform behavior.
@maksii maksii mentioned this pull request Oct 29, 2026
3 tasks done
HyunjunJeon (HyunjunJeon) pushed a commit to HyunjunJeon/hide that referenced this pull request Nov 12, 2026
Closes with-hide/hide-private#526
Closes with-hide/hide-private#599
Refs with-hide/hide-private#395, with-hide/hide-private#530,
with-hide/hide-private#117, with-hide/hide-private#586
Refs with-hide/hide-private#832

## Summary

- Start the checkout PR flow on Main after its setup has focused another
workspace.
- Prevent Windows test browsers from losing local page or resource
requests during shell startup.
- Retain the failed row and pointer state for a separate, unreproduced
late card-hover failure.

## Review

- **Risky files**: browser-launch.cjs merges installed runner defaults;
the desktop preload extends effective flags.
- **Risky files**: checkout-pr.spec.ts retains discovery's connection,
then resets first-run selection before Main.
- **Risky files**: desktop browser.spec.ts uses the shared arguments for
its plain Chromium launch and checks the applied features through CDP.
- **Decide**: The narrow upstream fix uses the locked runner's internal
argument API; a changed shape fails startup.
- An entire runner upgrade would also replace the browser revision and
is outside this stabilization change.
- **Cost**: The hover observer exists only for one test phase, retains
32 transitions, and is removed on every exit.
- **Cost**: Splitting the plain-browser notice from the native-view
lifecycle adds one isolated fixture start so Windows CI checks that
launcher too; its existing notice assertions are retained.
- [Windows run
41016473655](https://github.com/with-hide/hide/actions/runs/41016473655/job/123933953907),
tracked by [private
with-hide#130](with-hide/hide-private#130), records the
same document-load error.
- [with-hide#832](with-hide/hide-private#832) tracks
one later card-hover failure; this PR does not claim its cause is fixed.

## Tests

- **Layer**: Unit feature merging; real browser startup and desktop
recovery cross the actual host launch boundary.
- The desktop plain-browser case checks the effective final
disabled-feature list, retained runner defaults and the Windows loopback
fix before opening the shell.
- It passed its first Windows CI attempt on the final head in [the
desktop
lane](https://github.com/with-hide/hide/actions/runs/42860546110/job/129985854339).
- Units cannot observe which feature list the launched browser applies;
the startup check reads that applied state.
- **Catches**: Removing the Windows feature fix failed two merge checks;
restoring it passed all three.
- **Repeat**: Linux/macOS: five flows x20, [100 passed
each](https://github.com/with-hide/hide/actions/runs/42832076296).
- Desktop recovery/relaunch: each x10 on macOS/Windows, retries 0, [40
passed](https://github.com/with-hide/hide/actions/runs/42831271844).
- Final Windows: five flows x20, retries 0, [100
passed](https://github.com/with-hide/hide/actions/runs/42844846265/job/129929485236).
- **Waits**: No new wait, delay, retry, timeout or threshold; the
existing Main assertion follows explicit state setup.

## Evidence

- **Verified**: Local startup/checkout flows, desktop recovery/relaunch,
unit 3, lint, types, builds and policy checks.
- **Verified**: The split desktop plain-browser and native-view flows
passed locally without retries; desktop lint and typecheck passed.
- **Verified**: A controlled trigger replacement preserved the original
failure and captured mounts=2 before teardown.
- **Verified**: [Required
CI](https://github.com/with-hide/hide/actions/runs/42860546110) and
independent review passed on final head c532660.
- **Not verified**: The historical reference-only causes and the late
hover cause.

<details><summary>Failure evidence and review boundaries</summary>

- with-hide#526's run 42780431716 drew Workspace while the test expected Main
after setup focused its agents.
- with-hide#599's run 42080456072 had an unmounted shell, a successful document
and a failed entry script with ERR_NO_BUFFER_SPACE.
- Private with-hide#130 is handled separately by public PR with-hide#2372; its Windows
host log recorded window.load_failed ERR_NO_BUFFER_SPACE after a normal
daemon start.
- The test-only startup fix follows [the upstream
fix](microsoft/playwright#43605) and [the
browser defect](https://issues.chromium.org/issues/572515601).
- The locked runner 1.63 lacks that fix.
The helper reads its installed defaults rather than copying a
version-specific list.
- with-hide#395's run 42140863283 attached its daemon before its shell wait
failed, with no page-side or failed-load signature for that exact wait.
Its initial report used the retired fixture startup path; neither
identifies this PR's connection cause.
- with-hide#530's original failure drew Main with a failed sidebar boundary.
A controlled stylesheet abort reproduced that screen and a missing
CSS-token diagnostic, but the original artifact retained no
asset-failure signature.
- with-hide#117's latest retained record has only a whole-test timeout.
  Its historical lost step remains unidentified.
- with-hide#586's run 42359435922 explicitly reports the loopback error, but its
initial whole-test timeout and its separate focus flow were not resolved
by the targeted repetitions.
- For those next failures, inspect pageSide screen/project state,
request status, failed requests, renderFailures and renderDiagnostics.
The dump now retains failed regions and the newest eight relevant render
diagnostics.
Each reference-only issue has a comment with its confirmed facts,
remaining gaps and next dump.
- with-hide#536 was closed separately because commit 8be1505 deleted its Home
collision test.
  The current no-project startup spec does not replace that behavior.
- The first Windows repetition had 99/100 passes:
checkout-pr.spec.ts:273 failed at the final light-theme hover after the
shell, row, PR glyph and browser display had already drawn.
- A diagnostic-only repeat at 5eefccb passed 100/100: all 20 checkout
attempts retained one trigger mount, had PR facts ready and hit that row
with the pointer.
  The card opened after its normal hover delay.
  This did not reproduce or establish the cause of the earlier failure.
- The replacement diagnostic captures the failing state inside that
step, before teardown can add a disconnected banner and move the row.
It records the checkout key, mounts, pointer hit, geometry, focus,
visibility, drag marks and tooltip state, preserves the original error,
and reports independent cleanup failures.
- The old conversation-date fixture also caused automatic sleep of the
Main setup agent in the failed run.
A current-clock proposal removes that sleep locally, but its
relationship to the hover failure is unconfirmed.
  It remains an uncommitted local patch documented in with-hide#832.
- No product input, runtime mutex, snapshot wire or rendering path
changes.
  The operator's installed application was untouched.

</details>

<details><summary>Verification record</summary>

- Final head: c532660.
- Startup repeat candidate 4231d60:
Linux/macOS each five flows x20, no retry.
- Desktop repeat candidate ce0dffe:
JSON reports on each OS show expected=20, unexpected=0, skipped=0,
flaky=0, repeatEach=10 and retries=0.
- Diagnostic-only Windows candidate
5eefccb: run 42838637529, five flows
x20, no retry, 100 passed.
  The temporary early observer and trace flag were reverted.
- Final Windows repeat candidate
49b560a: run 42844846265, five flows
x20, retries=0, 100 passed; job log confirms the exact tested commit.
- All temporary workflow changes are reverted.
The repeated specs, shared startup fixtures and guide match the final
Windows repeat candidate; the later desktop browser.spec.ts regression
and its smaller size baseline are the only differences in those test
trees.
- Head 1933d66 is a source-identical verification commit after
f45c106, added to regenerate the synthetic merge against the corrected
base.
- Review follow-up c532660 applies the shared launch settings to the
desktop plain browser and separates that existing notice contract into a
Windows-covered case.
- Local current source: checkout hover flow passed without retries; a
controlled browser replacement captured the original failure and two
mounts; web lint and test-size budget passed.
- Earlier unchanged-source checks: web build; web/desktop lint; desktop
typecheck; startup/checkout 3; desktop recovery/relaunch 2; merge unit
3; design contract and policy checks passed.
- Manual repeat dispatches that skipped every test and draft-only verify
failures are excluded from verification evidence.
- Independent review and required CI 42860546110 passed on
c532660.
- Ready run 42849933157 checked synthetic merge
83a0f35 against base
8284fb6, which predates with-hide#2398.
- That merge still waited on the retired status.herdr field; current
main uses status.engine.
  All hard web failures were at that restart boundary.
  One required failed-job rerun was started.
- The regenerated merge f4ed9d1
includes the corrected status.engine wait.
- Final run 42860546110 tests merge
6b977ba containing c532660; completed
job logs confirm that checkout.
- Its Linux suite has 412 passes and eight Windows-only skips, the
retry-free changed-spec repeat has 80 passes, Windows web has 85 passes,
and Windows desktop has 24 passes and one existing platform skip.
The new plain-browser startup case passed its first attempt in 6.9
seconds.

</details>
BigFN'j (bigfnj) added a commit to bigfnj/MatrixDesktop that referenced this pull request Nov 13, 2026
…launch

What was wrong
The headless web smoke stalled about one full gate run in five (1 in 12
instrumented whole-smoke runs): check_glyph_intensity waited 60 s for frames
that never came. The one captured stall (fix-stall-scratch/stalls-A.jsonl:3)
shows GET /js/hostPointer.js on the smoke server's own loopback origin failing
with net::ERR_NO_BUFFER_SPACE 72 ms after navigation, so the import of
js/regl/main.js rejected, the page showed "Error loading renderer" and
window.matrixRuntimeDiagnostics stayed null.

Chromium on Windows asks for a randomized local port on each TCP connect
(feature TcpPortRandomizationWin, SO_RANDOMIZE_PORT). That connect can fail
with WSAENOBUFS (10055), which Chromium maps to ERR_NO_BUFFER_SPACE.
Playwright disables the feature by default since microsoft/playwright#43605.
The 1.62.0 on this box does not (its list, coreBundle.js:34606-34638, has 16
tokens and not this one) and CI pins the older 1.60.0.

Evidence: bounded A/B on this box
Browser: Playwright 1.62.0 headless shell 151.0.7922.34, Windows 11 10.0.26200,
Python 3.11.15. One page on web-smoke's own serve() (HTTP/1.0, one connection
per request); fetch with cache no-store and a unique query, 6 in flight; web
smoke's GL flags; a fresh browser with --log-net-log per trial. Arms
interleaved ABAB (run 1) then BABA (run 2), 12 trials per arm, 2000 connects
per trial unless box-wide TIME_WAIT pacing ended a trial early (pause above
4800, abort above 6000 or above 8000 distinct local ports >= 49152; no abort).
  A, Playwright defaults: 5 failed of 16100 connects. Per trial
    (attempted/failed): 2000/2, 200/0, 800/0, 2000/0, 2000/0, 1100/0,
    2000/1, 2000/0, 0/0, 2000/2, 0/0, 2000/0. All 5 were
    net::ERR_NO_BUFFER_SPACE, and every one's NetLog TCP_CONNECT_ATTEMPT
    ended with os_error 10055 (TCP_CONNECT net_error -176).
  B, TcpPortRandomizationWin merged into Playwright's one switch: 0 failed
    of 21200 (2000/0 ten times, 500/0, 700/0).
One-sided Fisher exact p = 0.015 for all 5 failures landing in A. Failures
came at box-wide TIME_WAIT from 1113 to 4867, and no 250 ms sample in either
run saw more than 2734 distinct local ports >= 49152 in use (dynamic range
16384), so this is not port exhaustion. Stress time 844 s. Five events
support the cause; they do not prove it, and these runs reproduced the
failed connect, not a whole stalled smoke.

Exposure: one glyph-intensity page load makes 38 requests and 38 TCP
connects against serve() as shipped (HTTP/1.0), and 6 with HTTP/1.1
keep-alive (3 loads each, interleaved, fresh browser per load). The server
class belongs to the fix/stall-report lane and is unchanged here.

The fix
tests/browser_launch.py now launches every Chromium a test fixture owns:
web-smoke.py (both launches, including the channel=chromium favicon check of
R2-56), zmatrix-configurator.py, matrix-playback-browser.py, uc3d-browser.py,
uc3d-calibration.py, uc3d-audio-browser.py, zmatrix-browser.py and
bloom-probe.py. native-uc3d-smoke.py and wallpaper-smoke.py attach to the real
app over CDP and are untouched.

The helper reads the --disable-features Playwright itself passed from a probe
launch's argv (no pinned copy of Playwright's list), then launches with ONE
switch holding those tokens, the suite's own and TcpPortRandomizationWin,
with Playwright's switch removed through ignore_default_args. It then checks
the launched browser's argv: exactly one --disable-features, the target, and
every probe token. Measured on 151.0.7922.34: an appended second switch
reaches argv as a second argument, and Chromium unions the two (every child
process got one switch with PaintHolding and the target); the helper does not
rely on that. If a Playwright already disables the target, the suite's
arguments go through untouched, because ignore_default_args also filters the
caller's args and would strip an identical merged switch, leaving none.

The argv is read from the browser process (pid from SystemInfo.getProcessInfo,
command line from NtQueryInformationProcess, equal to psutil's on the headless
shell, chromium 151 and msedge 157.0.4341.46). Browser.getBrowserCommandLine
refuses: "Command line not returned because --enable-automation not set", and
Playwright 1.62 does not pass that switch. SystemInfo.getFeatureState answers
"Unknown feature" for TcpPortRandomizationWin and PaintHolding on both builds
(DIPS answers true on chromium), so every launch prints the runtime feature
state as "not queryable on this build". The feature name is present in
chrome.dll and chrome-headless-shell.exe.

Each launch prints one line, "argument verification PASS ...; runtime feature
state: ...". A failed verification raises LaunchArgumentsError, a harness
error: the browser is not the configuration the suites were written against,
and the cause is a code or Playwright change, so it cannot flake. web-smoke
and zmatrix-configurator re-raise it past their "Chromium unavailable"
handlers, so it never becomes an UNVERIFIED exit 2. An argv that cannot be
read launches the suite's own arguments and prints DEGRADED on every run.

gate-lib.tests.ps1 copies web-smoke.py into scratch for R2-35 (b) and (c); the
copy now takes browser_launch.py with it.

Tests
tests/browser-launch.test.py, a tier-1 case in run-gate.ps1, on real headless
launches: Playwright passes a switch to keep; the helper's launch passes; a
Playwright that already disables the target is left untouched; an unreadable
argv prints DEGRADED and launches unchanged; three wrong launches made without
the helper are each named exactly (defaults alone: target missing; the merged
switch without ThirdPartyStoragePartitioning: that token missing; a second
--disable-features: 2 arguments).

Killing mutations, each on a copy of the helper beside a copy of the test (its
HELPER sha256 line shows the mutant ran; final helper f8adc15e), exactly one
FAIL each, the worktree file unchanged:
  M1 target dropped from the merge: FAIL helper launch,
     "TcpPortRandomizationWin is missing"
  M2 HttpsUpgrades dropped when the switch is written: FAIL helper launch,
     "Playwright default token(s) missing: HttpsUpgrades"
  M3 Playwright's switch kept and --disable-features=TcpPortRandomizationWin
     appended: FAIL helper launch, "2 --disable-features arguments, expected
     exactly one"
  M4 already-disabled guard removed: FAIL the untouched-arguments check
  M5 DEGRADED print silenced: FAIL the degraded check, printed ''
The same mutants under real suites (runpy, mutant first on sys.path):
web-smoke.py with M3 exit 3 "harness error: LaunchArgumentsError";
zmatrix-configurator.py with M1 exit 3 HARNESS ERROR, not UNVERIFIED;
zmatrix-browser.py with M2 exit 1 naming HttpsUpgrades.
R2-35 (b) and (c) without the gate-lib.tests.ps1 copy line: both FAIL under
5.1 and 7 (exit 1, the copy dies on the import), observed in the tier-1 run.

Runs after the fix
web-smoke.py whole, 5 runs: 5 green, 38 ok, 2 verified launches and no
DEGRADED in each, 61 to 80 s. Exit 0: uc3d-browser regl, zmatrix-browser
regl, matrix-playback-browser regl, uc3d-calibration regl (22 cases),
zmatrix-configurator (37/37), uc3d-audio-browser (msedge 157). Exit 2 as
designed: uc3d-calibration with the adapter hidden (CANNOT VERIFY WebGPU, what
its gate case expects) and bloom-probe (regl assertions pass, no WebGPU
readback headless). node renderer-lifecycle 48, uc3d-tests 56, zmatrix-tests
45: pass. Arm B through the helper: 0 failed of 3400 connects (2 trials).
Tier-1 gate (pwsh -Tier1Only, once): every check ok, including the new case
and the headless web smoke (38 checks), except R2-35 (b) and (c) under both
shells, fixed above; gate-lib.tests.ps1 alone then passed 40 cases under 5.1
(63 s) and 7 (22 s). Other agents were running tests on the box throughout.

Cost: the probe is one extra launch per channel per process. Launch time
median 1.06 s through the helper against 0.685 s plain (4 fresh processes
each, interleaved).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BigFN'j (bigfnj) added a commit to bigfnj/MatrixDesktop that referenced this pull request Nov 13, 2026
…t's own switch (MDST-03)

What was wrong
The self-test assumed the Playwright on the box lacks TcpPortRandomizationWin. Its
"Playwright defaults alone" control expected the target to be missing, and its
already-disabled fixture appended the target to the probe's baseline. On a Playwright that
passes the target itself (microsoft/playwright#43605, the configuration the helper supports),
verify_arguments correctly returns [] and the control failed, and the fixture held the target
twice, which launch_options deduplicates, so the untouched-options check failed a correct
helper. Reproduced at f299c8a with an argv reader that adds the target to Playwright's switch
(python -c driver, runpy of the test): FAILED 3 checks (the untouched-options check, the
defaults-alone control "expected ['TcpPortRandomizationWin is missing'], got []", and the
dropped-token control).

Fix (tests/browser-launch.test.py only)
Both shapes are built from the probe's tokens with the target taken out: without the target,
and with it once, so neither depends on which Playwright runs. A stand-in browser type
(Passing) makes pw.chromium pass a shape's switch, ignoring Playwright's real one, with
Playwright's own rule that ignore_default_args also filters caller args. launch_with() makes
the control launches whose --disable-features arguments are exactly the ones named. Per shape:
the helper's launch through the stand-in passes verification (the shape holding the target
goes through the helper's existing-target path on a real browser); the already-disabled
fixture gets the suite's arguments untouched; the defaults alone are named exactly (target
missing, or nothing when the shape holds it); one switch without the target, the merged switch
without one token, and a second switch are each named exactly. The real-shape helper launch
and the DEGRADED check are unchanged. 15 checks, was 7.

Tests and killing mutations (each in place, restored byte for byte, sha256 1b7eedc6 after)
- Unmutated: BROWSER LAUNCH SELF-TEST PASSED (15 checks), 36.5 s with other lanes building
  (7.6 s for 7 checks before; 16 launches now, 7 before).
- (a) defaults-alone expectation made unconditional ("target is missing"), mutant 69bb8bb7:
  exactly 1 FAIL, "Playwright that already disables the target, control Playwright defaults
  alone ... expected ['TcpPortRandomizationWin is missing'], got []".
- (b) already-disabled fixture back to own + "," + TARGET, mutant 86f7f561: exactly 1 FAIL,
  "Playwright that already disables the target: ... untouched: launch options were
  {'ignore_default_args': [...TcpPortRandomizationWin,TcpPortRandomizationWin], ...}".
- Helper guard removed (if False: in launch_options), on a copy of browser_launch.py beside a
  copy of the test (HELPER sha256 5948ebcb): 3 FAILs, both untouched checks and the stand-in
  helper launch for the target-holding shape ("0 --disable-features arguments"), which the old
  test could reach only through the pure check. Worktree helper unchanged (f8adc15e).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rostislav Rotaru (rostislavrotaru) added a commit to noldova-com/ui-components that referenced this pull request Nov 30, 2026
Closes #30

The second of the issue's two steps; the first, #273, keeps the test
servers' connections open, so a run opens about half as many.

## Why

On Windows 11, Chromium's `TcpPortRandomizationWin` feature gives each
new connection a random local port. That connect at times fails with
`net::ERR_NO_BUFFER_SPACE`, and every spec file importing the module it
was for then fails to import. Playwright 1.65.0 turns the feature off in
the Chromium it launches (microsoft/playwright#43605). We pinned 1.63.0.

## Change

- `src/noldova.ui.components.angular/package.json` and
`src/noldova.ui.components.angular.docs/package.json`: `playwright` goes
from 1.63.0 to 1.65.1.
- `package-lock.json`: `playwright` and `playwright-core` go to 1.65.1,
with the registry's tarball URLs and integrity hashes. Their
dependencies, engines (`node >=20`) and bins are unchanged, so nothing
else in the lockfile moves.

## Release notes reviewed: 1.64.0, 1.64.1, 1.65.0, 1.65.1

- The browser moves from Chromium 153.0.8010.12 (1.63.0) to
159.0.8154.6. It is still the headless shell, installed by the build's
`playwright install --only-shell chromium`.
- 1.64.0 adds WebMCP, video and screencast options, and
`testProject.default`; none is used here.
- 1.64.0's breaking changes:
- `screen` is now forwarded from device descriptors. Neither config uses
a device descriptor (`devices[...]`), so `window.screen` is unchanged.
- Elements inside a hidden iframe now count as hidden to actions and
visibility checks. Vitest runs each spec in a visible iframe on its test
page, so no spec's element becomes hidden.
- JSX now follows `tsconfig.json`, and `--update-snapshots=missing`
passes. Both are in Playwright's own test runner, which the kit doesn't
use.
- 1.64.1 fixes an Electron launch regression and a cross-origin redirect
abort when a route is registered; the kit registers no routes.
- 1.65.0's notable changes are in Playwright's own test runner (Bun,
reporters, test locks, `useDefineForClassFields` in its transpiler,
shard and location handling, `.css` imports), which the kit doesn't use:
Vitest runs the specs and only launches the browser through Playwright.
Of its library changes, cookie matching, proxy credentials and
`APIRequestContext` params aren't used; accessible names now leave out
text the browser doesn't render, which no spec reads through Playwright.
- 1.65.1 fixes two test-runner regressions (decorated classes with
static fields, Bun locations).
- Installation: the packages have no install scripts. 1.65.1 has been
published since 2026-11-13.

No look check moved: every spec in the run below passed unchanged.

## Checks

- On Linux, macOS and Windows, after `npm ci` and the Chromium 159
install, the pixel-reading specs (`settled-pixels`, `forced-highlights`,
`forced-spans`, `lines`), the screenshot specs (`screenshot.fixture`,
`short-screenshot-names`, `avatar.component`,
`configuration-table-row-hover`, `dialog.component`,
`diff-view.component`, `mention-field-chips`), `emulated-media` and the
network specs (`kept-connections`, `test-server-address`,
`failed-module-requests`, `code-block-spans`) pass: 276 tests in the
shared run and 38 in the isolated one, on each system.
- CI runs the whole suite on every target.
- The flake proof at this head, the whole suite 10 times on Windows x64
and 10 on Windows arm64, passed every run, with no
`net::ERR_NO_BUFFER_SPACE` logged.

Agent: DEV5 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
Rostislav Rotaru (rostislavrotaru) added a commit to noldova-com/desktop that referenced this pull request Nov 30, 2026
Closes #76

The second of the issue's two steps, stacked on #307, which keeps the
window test servers' connections open. This ports
noldova-com/ui-components#274.

## Cause, measured (#76's first done-when)

The failing requests were new connections, and the cause had two parts.
- **Connection churn.** The window test servers closed idle connections
after Node's 5 s default, so the browser kept opening new ones. A whole
window run on Windows 11 opened 61 connections, 40 of them after the
server had closed one idle. #307 keeps the connections for 10 minutes,
and the run now opens 30, all at the page's start.
- **Random-port connects on Windows.** Each new connection got a random
local port from Chromium's `TcpPortRandomizationWin`, and that connect
at times failed with `net::ERR_NO_BUFFER_SPACE`. Playwright fixed this
upstream in microsoft/playwright#43605, released in 1.65.0, by turning
the feature off. This PR takes it.

## Why

On Windows 11, Chromium's `TcpPortRandomizationWin` feature gives each
new connection a random local port. That connect at times fails with
`net::ERR_NO_BUFFER_SPACE`, and every window spec file importing the
module it was for then fails to import. Playwright 1.65.0 turns the
feature off in the Chromium it launches (microsoft/playwright#43605). We
pinned 1.63.0.

## Change

- `src/noldova.desktop.window.app/package.json`: `playwright` goes from
1.63.0 to 1.65.1, for the window tests' browser.
- `package.json`: `@playwright/test` goes from 1.63.0 to 1.65.1, for the
Electron end-to-end specs, so the lockfile keeps one Playwright copy.
- `package-lock.json`: `@playwright/test`, `playwright` and
`playwright-core` go to 1.65.1, with the registry's tarball URLs and
integrity hashes. Their dependencies, engines (`node >=20`) and bins are
unchanged, so nothing else moves.

### Differences from the source

ui-components#274 moved only `playwright`. Desktop also has Playwright's
test runner, so this PR moves `@playwright/test` too, and the review
below covers the runner's changes.

## Release notes reviewed: 1.64.0, 1.64.1, 1.65.0, 1.65.1

- **Browsers:** the window tests' browser moves from Chromium
153.0.8010.12 to 159.0.8154.6, still the headless shell that the build
installs. The end-to-end specs drive the app's own Electron, which this
doesn't change.
- **1.64.0's breaking changes:**
- `screen` is now forwarded from device descriptors. No config here uses
one.
- Elements inside a hidden iframe now count as hidden. Vitest's spec
iframe is visible, and the end-to-end specs read web views' frames
through the main process, not Playwright's actions.
  - JSX in test files follows `tsconfig.json`; the specs have no JSX.
- `--update-snapshots=missing` passes; no spec here compares snapshots.
- **1.64.1** fixes `_electron.launch` sometimes losing a packaged app's
first window, a regression from 1.64.0. The end-to-end fixture,
`src/noldova.desktop.electron/tests/e2e/fixtures/main-process.fixture.ts`,
waits for that first window.
- **1.65.0's notable changes:**
- TypeScript class fields now follow `useDefineForClassFields`, which is
on for the repository's ES2025 target. A field initializer that reads a
constructor parameter property breaks under it. The specs and fixtures
have no parameter properties. Their subclasses, the exceptions, only add
fields set in the constructor. The decorated components are fixture
modules that Angular builds, not Playwright.
- Actions such as `click`, `check`, `fill` and `selectOption` now wait
for their element not to be inert, and time out if it stays inert. The
window does use `inert`:
    - the workspace while it reconnects (`workspace.component.ts`);
    - the page behind a dialog (`dialog-cover.service.ts`);
    - a folded window row's content (`window-row.component.html`);
    - a live view while it is held (`models/live-view.ts`).
No end-to-end test acts on inert content, so none waits under the new
rule: CI's end-to-end run and the window flake proof pass.
- A sharded run with no tests in any shard now fails. Every CI shard
here has specs.
- Test locations of CommonJS calls move to the callee's start. The specs
are ESM, so nothing moves.
- Blob reports clear their folder again. This repository doesn't use the
blob reporter.
- The rest, cookie matching, proxy credentials and `APIRequestContext`
params, isn't used here, and `.css` imports aren't used in the specs.
- Accessible names and aria snapshots now leave out text the browser
doesn't render, such as text in a closed `<details>`. The end-to-end
specs query by role and name, such as `getByRole("dialog", { name: "Work
is still running" })`. `main-process.fixture.ts:557` reads a question's
text with `ariaSnapshot()`. Each names rendered text, so neither should
change; CI's full end-to-end run checks every one.
- **1.65.1** fixes two runner regressions: decorated classes with static
fields, and locations under Bun.
- **Installation:** none of the three packages has an install script.
1.65.1 has been published since 2026-11-13.

## Checks

- **Before the push,** on Linux, macOS and Windows after `npm ci` and
`npm run build` (one copy of each package, all 1.65.1):
- the window specs `test-server-connections`, `test-server-address` and
`failed-module-requests` pass;
- `activity-bar.spec.ts` and `bar-edges.spec.ts`, run as `--shard=1/2`
and `--shard=2/2`, pass. Every spec launches through the fixture above,
so this covers the first window, a sharded set, and a fixture class with
field initializers.
- **CI** passed: the whole suite on every target, and the end-to-end
specs on Linux x64, each shard within the times of main's and other PRs'
runs (see the comment).
- **The flake proof** at 9155a30, every window spec on Windows arm64,
passed 10 of 10 runs of all 282 spec files, with no
`ERR_NO_BUFFER_SPACE` logged.

## Not checked

- The end-to-end specs on Windows and macOS with 1.65.1 beyond the two
specs above. A PR's CI runs them on Linux only, and main's end-to-end
workflow runs Windows x64 after the merge.

Agent: DEV5 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
Rostislav Rotaru (rostislavrotaru) added a commit to noldova-com/browser that referenced this pull request Nov 30, 2026
…, and log the recording proxy's side (#131)

## What and why
`permissions.spec.ts:105` failed once on main at d7fe00f, on Windows
x64. The engine's load of `http://public.test:63811/` failed 56 ms after
it started with `ERR_PROXY_CONNECTION_FAILED`, before the test's
recording proxy reached the fixture server (#130). The run couldn't show
which side failed.

The likely cause is Chromium's `TcpPortRandomizationWin`. On Windows it
gives each new connection a random local port, and that connect at times
fails with `ERR_NO_BUFFER_SPACE` (https://crbug.com/572515601). A failed
connect to a proxy comes back as `ERR_PROXY_CONNECTION_FAILED`, which
hides that code. desktop#76 and ui-components hit the same feature
against their test servers. Playwright 1.65.1 turns it off in the
Chromium it launches (microsoft/playwright#43605). The e2e app is
launched by Electron, not Playwright's Chromium, so that change doesn't
apply here.

This PR:
- turns the feature off in the e2e app with
`--disable-features=TcpPortRandomizationWin`;
- logs the recording proxy's side, attached to a failed test, so a next
failure shows where it broke.

## Changed
- `e2e/fixtures/launch-settings.ts`: the new launch setting, with its
reason and sources. The feature is defined in Chromium's
`net/base/features.cc` and used in `net/socket/tcp_socket_win.cc`.
Neither the app nor any other e2e setting passes `--disable-features`,
so the switch doesn't replace another.
- `e2e/fixtures/recording-proxy.ts`: a `log`, each line with its time:
- each connection the engine opens to the proxy, with the engine's port,
and its close, on an error or not;
  - each request, and whether the proxy passed or recorded it;
- each forward or tunnel to a fixture server, with the proxy's own local
port, or a reused connection's;
  - the forward's answer;
  - every error on either side with its code and message;
  - a client that sends what isn't HTTP.
  Before, the proxy dropped the error of a failed forward or tunnel.
- `e2e/fixtures/app-test.ts`: a failed test attaches the log as
`proxy.log`, beside `requests.log` and `views.log`.
- `documents/TESTING.md`: the new launch setting and `proxy.log`.

## Tests
- `e2e/tests/recording-proxy.test.ts`, three new tests:
- A passed request's lines, in order: the client's connection, the
request, the forward's connection from its own port, and the answer. The
test reads the ports from the client.
- A forward to a port nothing listens on: `ECONNREFUSED` with its
message, then the client's connection closed.
- A recorded request, a tunnel that opens, a tunnel that fails with
`ECONNREFUSED`, and a client that doesn't speak HTTP (`HPE_…`). Each
line must start with its time.
  - Without the log, each test fails to compile or finds no lines.
- Before the push, on Linux, macOS and Windows test machines, at
02c913d: the proxy's 5 unit tests passed, and so did the e2e specs that
use the proxy and the failure logs: `permissions`, `subresources`,
`test-app` and `failure-logs`.
- Flake proof of `permissions.spec.ts:105` on Windows x64 at 02c913d: 10
runs in 2 jobs of 5, 10 passed, 0 failed
(https://github.com/noldova-com/browser/actions/runs/46452651590).
- The failure came once in browser's last 60 Build and test runs, about
1 in 60. A single proof can't show that rate is gone. If it comes back,
`proxy.log` shows whether the engine's connection reached the proxy.

## Not changed
Whether Noldova Desktop itself turns the feature off for people is
desktop#315. This PR doesn't decide it.

## Linked issue
Issue: #130

## Testing
- Tests: as above.
- Manual: none.
- Not checked: the attachment of `proxy.log` from a real failed run,
which comes with the next failure.

Agent: DEV2 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
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.

[Feature]: Disable Chromium feature "TcpPortRandomizationWin" by default

2 participants