GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: let the OS choose the vitest browser fixture's server port by wan9chi · Pull Request #838 · voidzero-dev/vite-task

Conversation

@wan9chi

@wan9chi wan9chi commented Oct 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Motivation

vitest_browser_cache::vitest_browser_caches_inputs_and_restores_outputs fails intermittently on Windows runners in the Test (windows-ignored) job:

Error: listen EACCES: permission denied ::1:63315

63315 is the fixed default port for Vitest browser mode's server. Windows reserves dynamic port ranges (Hyper-V/WinNAT excluded port ranges), and listening on a reserved port fails with EACCES. Vite only tries another port on EADDRINUSE, so the run fails, dist/result.json is never written, and the snapshot diverges. It depends on which runner the job lands on: it failed on #824 and #825 and passed on other runs of the same code.

Changes

The fixture's browser server now listens on port 0, so the OS chooses a free port. Vite supports server.listen(0) directly, but the config can't request it the normal way:

  • test.api: { port: 0 }: Vitest only copies api.port when it is truthy, so 0 falls back to 63315.
  • Setting test.api at all, even with a concrete port, adds an API started at http://localhost:<port>/ banner line that would change the snapshot. test.browser.api prints a deprecation warning in Vitest 5.

Instead, a small enforce: 'post' plugin sets test.api.port = 0 after Vitest resolves test.api. The banner stays unchanged, and the snapshot is identical.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Oct 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +1.81%  [-13.90% .. +20.58%]  overhead   +58.39%
dynamic/access             change  -0.35%  [-15.53% .. +72.88%]  overhead   +11.12%
dynamic/access-relative    change  -0.39%  [ -6.64% ..  +5.03%]  overhead   +44.51%
dynamic/access-contended   change  +1.18%  [ -4.36% ..  +5.62%]  overhead    +4.88%
static/launch              change  +6.57%  [-21.10% .. +43.68%]  overhead  +168.19%
static/access              change  -0.67%  [-18.52% .. +18.87%]  overhead  +852.64%
static/access-relative     change  -2.92%  [-10.28% ..  +5.22%]  overhead +1228.54%
static/access-contended    change  +2.79%  [ -5.63% .. +10.34%]  overhead +2220.67%

macos

dynamic/launch             change  +0.14%  [ -4.03% ..  +4.79%]  overhead  +234.18%
dynamic/access             change  -0.33%  [-56.44% .. +13.08%]  overhead    +5.47%
dynamic/access-relative    change  -0.87%  [-15.90% .. +16.35%]  overhead  +248.98%
dynamic/access-contended   change  +2.38%  [-50.83% .. +637.48%]  overhead    +2.72%

windows

dynamic/launch             change  +0.51%  [ -2.85% ..  +3.89%]  overhead   +26.13%
dynamic/access             change  +0.00%  [ -1.23% ..  +0.93%]  overhead    +1.15%
dynamic/access-relative    change  +0.19%  [ -0.92% ..  +0.96%]  overhead    +0.95%
dynamic/access-contended   change  +0.00%  [ -1.06% ..  +1.31%]  overhead    +1.31%
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wan9chi @claude
test: let the OS choose the vitest browser fixture's server port
0db9d70
Vitest browser mode listens on the fixed port 63315 by default. On Windows
runners that port can fall inside an excluded port range, where listening
fails with EACCES and Vitest does not fall back to another port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wan9chi
wan9chi force-pushed the claude/dazzling-cartwright-4d060c branch from 410f406 to 0db9d70 Compare October 12, 2026 05:25
@wan9chi
wan9chi merged commit e5d73d2 into main Oct 12, 2026
21 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@wan9chi
wan9chi deleted the claude/dazzling-cartwright-4d060c branch October 12, 2026 05:31
@wan9chi wan9chi mentioned this pull request Oct 12, 2026
test: use available API ports in browser snapshots voidzero-dev/vite-plus#3006
Merged
fengmk2 added a commit to voidzero-dev/vite-plus that referenced this pull request Oct 12, 2026
@fengmk2
test: use available API ports in browser snapshots (#3006)
205cfab
The browser snapshots use Vitest's fixed API port, which Windows can
reserve. This causes intermittent `EACCES` failures.

Set `test.api.port` to `0` in a post-configuration hook, after Vitest
resolves its defaults. The OS selects an available port when the server
binds. This follows
[vite-task#838](voidzero-dev/vite-task#838) and
preserves the snapshot assertions.
This was referenced Oct 14, 2026
Pick lower ephemeral port for browser mode vitest-dev/vitest#9035
Closed
fix(browser): change default port to 23315 vitest-dev/vitest#11640
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@wan9chi
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.