From 9b40c85cd0e866c3925db8f4c5f46d55c12bc4b9 Mon Sep 17 00:00:00 2001 From: JUN Date: Sat, 7 Nov 2026 10:26:11 +0900 Subject: [PATCH] test(link): hand the stop/sync fixtures the native CODEX_HOME spelling Hosted Windows TEMP is an NTFS 8.3 alias (C:\Users\RUNNER~1). realpathSync keeps the short name while the sync process canonicalizes CODEX_HOME with realpathSync.native, so its catalog path hashed to a different backup and restoration stripped the catalog to []. --- tests/clients/client-link-stop.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/clients/client-link-stop.test.ts b/tests/clients/client-link-stop.test.ts index 0a68e736791..697e1e2f563 100644 --- a/tests/clients/client-link-stop.test.ts +++ b/tests/clients/client-link-stop.test.ts @@ -248,9 +248,11 @@ for (const preserve of ["service", "desktop", "receipt", "sibling"]) { for (const { releaseFirst, hold } of [{ releaseFirst: false, hold: "catalog" }, { releaseFirst: false, hold: "home" }, { releaseFirst: true, hold: "catalog" }, { releaseFirst: false, hold: "lock" }] as const) { test(`a separate sync ${releaseFirst ? "finishes before" : "cannot commit after"} signal restoration (${hold})`, async () => { const root = mkdtempSync(join(tmpdir(), "ocx-link-sync-stop-")); - // Sync records the canonical catalog path (/private/var on macOS) and backup lookup hashes the - // spelling, so the fixture must create its native backup under the same spelling. - const home = join(root, "ocx"), codex = join(realpathSync(root), "codex"); + // Sync records the canonical catalog path (/private/var on macOS, the long name for an NTFS + // 8.3 temp alias such as C:\Users\RUNNER~1 on hosted Windows) and backup lookup hashes the + // spelling. The runtime starts before CODEX_HOME exists and so keeps the spelling it is given; + // only the native resolver expands short names, so the fixture must hand both processes it. + const home = join(root, "ocx"), codex = join(realpathSync.native(root), "codex"); const children: Array<{ child: ReturnType; drained: Promise }> = []; const spawn = (file: string, options: unknown) => { const child = Bun.spawn([process.execPath, fixturePath(file)], {