Skip to content

Windows unit jobs fail on main since #1955: slow-lane tests report the test file under a ../ path #2027

Done

Description

@V3RON

What happened

Since #1955 (Dependabot npm group, merged as bde50b5), three unit tests fail on every main run on the Windows unit jobs. Every PR's merge gate is refused, because CI is red.

  • src/slow-lane-triage.test.ts > "a suite whose beforeAll failed and a file that failed to load are failures, not none, each with a rerun that selects it"
  • src/slow-lane-triage.test.ts > "the printed rerun, run through sh, selects exactly the failed test of a real vitest file"
  • src/slow-e2e.test.ts > "status of a run whose suite hook failed prints the suite as failed and its tests as not run because of it"

The reported test path changes from e2e/slow-x.test.ts to one relative to another folder (../../../../../runneradmin/AppData/Local/Temp/slow-rerun-…/e2e/slow-x.test.ts).

What you expected

Main green on Windows, as at 9b28b45 (the commit before #1955).

How to reproduce

Run src/slow-lane-triage.test.ts on Windows at bde50b5 or later. Lead, not proven: #1955 moved vitest 5.1.0 → 5.1.2 and vite 8.3.7 → 8.4.0. The test's temp folder may now be reported relative to the root through a different spelling of the runner's temp path.

Environment

GitHub Actions Windows unit jobs (1/3), runs 46847067975 (bde50b5) and 46847827351 (feaf4f8). Main at 9b28b45 passed (46842701547). Linux and macOS jobs pass.

Logs and evidence

- "SLOW END passed 0s e2e/slow-x.test.ts > agent-device (iOS) > x > it's $1 [a] (b)",
+ "SLOW END passed 0s ../../../../../runneradmin/AppData/Local/Temp/slow-rerun-0PSW1O/e2e/slow-x.test.ts > agent-device (iOS) > x > it's $1 [a] (b)",
  ❯ src/slow-lane-triage.test.ts:312:77

Written by an agent.

Activity

  1. added
    bug:new
    on Dec 2, 2026
  2. assigned and unassigned on Dec 2, 2026
  3. V3RON commented on Dec 2, 2026

    @V3RON
    ContributorAuthor

    Reproduction

    Seen on: tool output, the Windows unit job (1/3) of run 46847067975 (same runner image as passing run 46842701547).

    e2e/progress-reporter.test.ts > "prints the test file relative to the project when the working directory reaches the project through a link", on bug/2027-repro. A symlink stands in for the 8.3 short name: process.cwd() returns the link, as Windows returns C:\Users\RUNNER~1\….

    pnpm test:e2e e2e/progress-reporter.test.ts
    -   "SLOW START e2e/slow-x.test.ts > lease > ends on release",
    -   "SLOW END passed 0s e2e/slow-x.test.ts > lease > ends on release",
    +   "SLOW START ../progress-root-6OKjGr/e2e/slow-x.test.ts > lease > ends on release",
    +   "SLOW END passed 0s ../progress-root-6OKjGr/e2e/slow-x.test.ts > lease > ends on release",
     ❯ e2e/progress-reporter.test.ts:85:55
    

    Root cause

    Defect. e2e/progress-reporter.ts:13 prints relative(process.cwd(), testCase.module.moduleId), which assumes vitest spells the module id the way the working directory is spelled. Vitest never promised that. Vite realpaths the project root (safeRealpathSync in resolveConfig), and vitest finds test files under that root. #1955 brought in vite 8.4.0, which includes vitejs/vite#24014: on Windows, safeRealpathSync used fs.realpathSync until net use answered, and now calls fs.realpathSync.native at once. The native call expands 8.3 short names, so module ids became C:/Users/runneradmin/… while process.cwd() stayed C:\Users\RUNNER~1\…. Five ../ reach C:\Users, which is exactly the CI diff. Vitest 5.1.0→5.1.2 changes no realpath call. On POSIX, process.cwd() is already physical.

    probe on macOS: vitest run --root /var/folders/…/probe-kGPr
    config.root      /private/var/folders/…/probe-kGPr
    moduleId         /private/var/folders/…/probe-kGPr/e2e/x.test.ts
    relativeModuleId e2e/x.test.ts
    

    Simplest fix

    In e2e/progress-reporter.ts, print testCase.module.relativeModuleId (vitest: "Module id relative to the project. This is the same as task.name") and drop the node:path import.

    pnpm exec vitest run --project e2e --tags-filter='!slow' e2e/progress-reporter.test.ts   3 passed
    pnpm exec vitest run --project unit src/slow-lane-triage.test.ts src/slow-e2e.test.ts src/slow-lane-nightly.test.ts   49 passed
    pnpm typecheck   exit 0
    

    Alternatives rejected

    • Realpath both cwd and module id: two syscalls per line to rebuild what vitest gives.
    • Realpath the tests' temp folders: CI goes green, but the reporter stays wrong behind a link.
    • Pin vite: a link still breaks the reporter.

    Risk

    • The fix has not run on Windows (DesktopWindows did not resolve from this session); the fix PR's Windows unit job checks it.
    • On Windows, lines now use / instead of \; .agents/scripts/slow-lane-log.mjs:86 already turns \ into /.
    • Paths are relative to the e2e project root, which is the repo root the lane runs from.

    Fast track

    • Defect: yes
    • Fix tried: yes
    • Nothing public added or broken: yes
    • No ADR or rule changed: yes
    • One fix: yes

    Written by an agent.

  4. added
    bug:ready
    fast-track
    and removed
    bug:new
    on Dec 2, 2026
  5. self-assigned this
    on Dec 2, 2026
  6. V3RON commented on Dec 2, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: #2032 (#2027)
    Parked: none
    Waiting: none
    Decided: none
    Asleep: 15 min

    Written by an agent.

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

Metadata

Metadata

Assignees

Labels

bug:readyfast-track

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions