diff --git a/src/core/device-root.test.ts b/src/core/device-root.test.ts index 91a7f635d..761f2d272 100644 --- a/src/core/device-root.test.ts +++ b/src/core/device-root.test.ts @@ -193,6 +193,19 @@ describe("ensureOwnedRoot", () => { }, ); + it("refuses as unreadable a root whose rename failed with another code, ENOSPC, even when another process published it first", async () => { + const filesystem = new RefusingRenameFilesystem( + uid, + async (target) => { + await target.mkdirp(root); + await target.writeFileAtomic(markerPath, marker()); + }, + "ENOSPC", + ); + + await expect(refusal(filesystem)).resolves.toBe("unreadable"); + }); + it("still refuses a root whose rename was refused with EPERM when nothing else published it", async () => { const filesystem = new RefusingRenameFilesystem(uid, async () => undefined); diff --git a/src/drivers/android/prerequisites.test.ts b/src/drivers/android/prerequisites.test.ts index 2edb2c5a3..55695a1d9 100644 --- a/src/drivers/android/prerequisites.test.ts +++ b/src/drivers/android/prerequisites.test.ts @@ -333,6 +333,8 @@ describe("androidPrerequisites on Windows", () => { it.each([ ["ANDROID_HOME", { ANDROID_HOME: winSdk }, winSdk], ["Android Studio's %LOCALAPPDATA% default", { LOCALAPPDATA: "/Volumes/Data/Local" }, localSdk], + ["/AppData/Local when LOCALAPPDATA is unset", {}, winSdk], + ["/AppData/Local when LOCALAPPDATA is empty", { LOCALAPPDATA: "" }, winSdk], ])( "finds a complete SDK of .exe and .bat tools through %s and runs its sdkmanager.bat", async (_source, env, root) => { diff --git a/src/ports/paths.test.ts b/src/ports/paths.test.ts index 5f7a9e860..e9ebf1c12 100644 --- a/src/ports/paths.test.ts +++ b/src/ports/paths.test.ts @@ -72,6 +72,13 @@ describe("resolveDaemonSocketPath", () => { expect(isPipeEndpoint(endpoint)).toBe(true); }); + it("names the pipe simlock- and the first 16 hex characters of the SHA-256 of the lower-cased data directory, as the client docs say", () => { + // why: `printf '%s' 'c:\users\me\.simlock' | shasum -a 256` starts 9b8d70a31742e257. + expect(resolveDaemonSocketPath(home, "win32")).toBe( + String.raw`\\.\pipe\simlock-9b8d70a31742e257`, + ); + }); + it("gives one data directory one name, whatever its case, and two directories two", () => { const endpoint = resolveDaemonSocketPath(home, "win32"); diff --git a/src/ports/process-supervisor.test.ts b/src/ports/process-supervisor.test.ts index 53bc740e5..daa579bb8 100644 --- a/src/ports/process-supervisor.test.ts +++ b/src/ports/process-supervisor.test.ts @@ -143,11 +143,23 @@ describe("NodeProcessSupervisor.commandLine", () => { ); it.each([ - ["linux", "exits non-zero", "ps", posixRead, { code: 1 }], + ["linux", "exits non-zero", "ps", posixRead, { code: 1, stdout: "/usr/bin/node a.js\n" }], ["linux", "prints nothing", "ps", posixRead, { stdout: "\n" }], - ["win32", "exits non-zero", "powershell.exe", windowsRead, { code: 1 }], + [ + "win32", + "exits non-zero", + "powershell.exe", + windowsRead, + { code: 1, stdout: "node a.js\r\n" }, + ], ["win32", "prints nothing", "powershell.exe", windowsRead, { stdout: "\r\n" }], - ["win32", "is ended at its time limit", "powershell.exe", windowsRead, { code: null }], + [ + "win32", + "is ended at its time limit", + "powershell.exe", + windowsRead, + { code: null, stdout: "node a.js\r\n" }, + ], ] as const)( "answers undefined on %s when the read %s", async (platform, _case, command, args, result) => {