Skip to content

test/containment.test.ts: 2 of 7 symlink tests miss the file's win32 skip guard and EPERM on unprivileged Windows #147

Closed

Description

@WhollyMindless

On Windows dev machines without developer mode, two tests in test/containment.test.ts are red before they ever exercise product code — the fixture's own symlinkSync call throws EPERM:

  • resolveContained > a dangling symlink in the path is refused, not waved through (symlinkSync at line 171)
  • resolveContained > a link to another file INSIDE the root is refused, not followed (symlinkSync at line 315)

Repro: any Windows machine with developer mode off (registry AllowDevelopmentWithoutDevLicense absent, token lacks SeCreateSymbolicLinkPrivilege — checkable via whoami /priv):

bun test test/containment.test.ts    # Bun 1.4.4, git on PATH
=> EPERM: operation not permitted, symlink ... (thrown by the test setup, not by resolveContained)

The file already knows this pattern: its five other symlink-dependent tests carry test.skipIf(process.platform === "win32") (lines 190, 242, 322, 339, 349), and repokey-path.test.ts sidesteps the privilege entirely by creating a junction on win32 (line 78). These two tests slipped through the guard — the 2 of 7.

Why it reads like more than it is: on an unguarded Windows box these two ride along with the otherwise all-green suite as an unexplained red, next door to the resolveContained tests that DID go green once Bun matched the CI pin (the O_NOFOLLOW/EINVAL cluster was Bun-1.3.x-only). Triage cost: proving each red is environmental takes a pristine-main baseline run every time.

Suggested fix, either:

  1. match the file's existing pattern — test.skipIf(process.platform === "win32"); or, slightly better,
  2. skip by capability rather than platform: a one-shot probe (symlinkSync into a temp dir, t.skip() on EPERM). GitHub's Windows runners can create symlinks (test-windows is green on exactly these tests), so a capability skip keeps real coverage where it exists while staying silent on unprivileged dev boxes.

No product implication: resolveContained's refusal logic is not what fails here — the fixture can't build its props.

Activity

  1. WhollyMindless commented on Oct 28, 2026

    @WhollyMindless
    ContributorAuthor

    Taking this one — branch fix/test-windows-147-148 off 0.14.14, paired with #148 (same theme: Windows test-harness reds that aren't product failures; one small review).

    Going with the capability-skip option: a one-shot symlinkSync-into-tempdir probe gates exactly the two unguarded tests (skip() on EPERM), so GitHub's Windows runners keep running them green (they have the privilege — test-windows proves it) while unprivileged dev boxes stop paying the triage cost. The file's five existing skipIf(win32) guards stay as they are — this commit only stops the fixture from throwing before resolveContained is ever called. No product-code change.

    Field corroboration: these two reds have ridden along every bun run test on this Windows contributor machine throughout the #127–#132 program and are footnoted in the #156/#158 PR bodies as the known environmental pair — exactly the triage-tax pattern this issue describes.

  2. added a commit that references this issue on Oct 28, 2026
  3. abogartz-opencode-self-improvement commented on Oct 28, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.14.16 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions