Skip to content

Conversation

@mcollina
Copy link
Member

@mcollina mcollina commented Feb 4, 2026

Summary

Fixes flaky test-node-output-sourcemaps test on Windows CI.

Problem

On Windows, file paths are case-insensitive but JavaScript string comparison is case-sensitive. When the drive letter case differs between the computed project root (e.g., C:/workspace/...) and the actual output from child processes (e.g., c:/workspace/...), the path replacement in transformProjectRoot() would fail.

This causes snapshot tests to fail with errors like:

Expected values to be strictly equal
actual: 'c:/workspace/node-test-binary.../test/fixtures/...'
expected: '<project-root>/test/fixtures/...'

Solution

Use case-insensitive regex replacement (gi flag) on Windows to ensure paths are correctly normalized regardless of drive letter casing.

Verification

Tested locally with python3 tools/test.py --repeat 20 test/parallel/test-node-output-sourcemaps.mjs - all passed.

Refs: nodejs/reliability#1453

On Windows, file paths are case-insensitive but string comparison is
case-sensitive. When the drive letter case differs between the computed
project root and the actual output (e.g., 'C:/' vs 'c:/'), the path
replacement in transformProjectRoot() would fail.

This fix uses case-insensitive regex replacement on Windows to ensure
paths are correctly normalized in snapshot tests regardless of drive
letter casing.

Refs: nodejs/reliability#1453
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Feb 4, 2026
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.76%. Comparing base (8c32389) to head (08d1976).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61682      +/-   ##
==========================================
+ Coverage   89.75%   89.76%   +0.01%     
==========================================
  Files         674      674              
  Lines      204394   204394              
  Branches    39278    39274       -4     
==========================================
+ Hits       183448   183482      +34     
+ Misses      13238    13232       -6     
+ Partials     7708     7680      -28     

see 31 files with indirect coverage changes

🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants