Skip to content

test: guard balanced-pool error port lookup#5463

Open
mcollina wants to merge 1 commit into
mainfrom
fix/windows-balanced-pool-error-guard
Open

test: guard balanced-pool error port lookup#5463
mcollina wants to merge 1 commit into
mainfrom
fix/windows-balanced-pool-error-guard

Conversation

@mcollina

Copy link
Copy Markdown
Member

This relates to...

Windows flake in test/node-test/balanced-pool.js where an error object may not include nested socket metadata.

Rationale

The weighted round-robin test assumed all request errors expose error.socket.remotePort. On Windows, some transient errors can be missing socket, causing the test harness to throw a masking TypeError instead of handling or surfacing the original error.

Changes

Features

N/A

Bug Fixes

  • Add a helper to safely read ports from request errors.
  • Handle AggregateError children with the same safe lookup.
  • Rethrow the original error when it cannot be mapped to a test server.

Breaking Changes and Deprecations

N/A

Status

Tested with:

  • npx borp -p "test/node-test/balanced-pool.js"
  • npm run lint -- test/node-test/balanced-pool.js
  • git diff --check

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.47%. Comparing base (667d8a3) to head (68eeca8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5463      +/-   ##
==========================================
- Coverage   93.48%   93.47%   -0.02%     
==========================================
  Files         110      110              
  Lines       37115    37115              
==========================================
- Hits        34697    34693       -4     
- Misses       2418     2422       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina requested a review from trivikr June 29, 2026 16:34
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.

2 participants