Skip to content

tests: full suite on native Windows stops the live Tower and fails on main (launchers.windows port 4100, EPERM temp cleanup) #1922

Closed

Description

@amrmelsayed

Problem

On a native Windows developer machine the packages/codev unit suite cannot be run safely or to green on main, which blocks every porch builder: porch's tests check is the full suite.

Observed 2026-11-18 (Windows 11, main at 5e328c5):

  1. The suite stops the developer's live Tower. packages/codev/src/__tests__/launchers.windows.test.ts starts its own Tower on the default port 4100 with only the state directory isolated (file header, lines 18-19), and its afterAll (line 243) runs afx tower stop, which on Windows stops whatever owns the port. At ~00:19Z three builders' full-suite runs stopped the owner's live Tower (tower.log ends mid-run with no shutdown entry). Messaging, dashboards and gate delivery were down until a manual restart.
  2. EPERM on temp-dir cleanup. cold-tier-materialization.test.ts:91 (fs.rmSync(projectDir, { recursive: true, force: true }) in afterEach) fails with EPERM, Permission denied for 2 of 7 tests; reproduced on main by the architect. Builders report the same failure shape in update.test.ts (bootstrap-docs hint) and the hot-tier tests.
  3. Reported by builders, not yet confirmed on main: bugfix-1691-tower-start-surface-refusal fails; launchers.windows.test.ts and agy-auth-cache are flaky; in apps/vscode, diff-nav fails against base and preflight-version-timeout spawns a .sh directly.

GitHub's Windows workflow is green on the same code (run 44208299681 on builder/pir-1917), so these are specific to a developer machine with a live Tower and/or real temp-dir semantics, not to Windows as such.

Fix shape

  1. First, make the launchers test unable to touch a live Tower. It must never stop a Tower it did not start: either run its Tower on a non-default port (if the CLIs under test can be pointed at one), or detect a Tower already listening on 4100 before starting and skip the file with a loud message, and scope the afterAll stop to the PID it started. Until this lands, do not run this file or the full suite on a machine with a live Tower.
  2. Find the cause of the EPERM cleanups (a handle still open, cwd still inside the directory, a child still running) and fix it at the cause; a retrying rmSync is acceptable only with the cause named.
  3. Triage item 3: confirm each on main, then fix it or file it with evidence. agy-auth-cache flakiness may be a separate issue.

Acceptance

  • With a live Tower running on 4100, pnpm --filter @cluesmith/codev test on native Windows leaves that Tower running (same PID before and after).
  • The suite passes on the owner's Windows machine, or every remaining failure is named in the PR with a linked issue.
  • macOS/Linux and the GitHub Windows workflow stay green.

Blocks: #1917, #1919, #1920, #1921 (all held at porch's tests check).

Activity

  1. added
    area/cross-cutting
    on Nov 18, 2026
  2. amrmelsayed commented on Nov 18, 2026

    @amrmelsayed
    CollaboratorAuthor

    On it! Working on a fix now.

  3. added 12 commits that reference this issue on Nov 18, 2026
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

    area/cross-cutting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions