@@ -75,6 +75,9 @@ const SLOW_SERVER = [ |
75 | 75 | "", |
76 | 76 | ].join("\n"); |
77 | 77 |
|
| 78 | +// The launcher mounts only under setsid, which stock macOS and Windows lack; there it extracts instead. |
| 79 | +const hasSetsid = NodeChildProcess.spawnSync("setsid", ["true"]).status === 0; |
| 80 | + |
78 | 81 | const lines = (stream: NodeJS.ReadableStream) => { |
79 | 82 | const seen: Array<string> = []; |
80 | 83 | const waiters: Array<() => void> = []; |
@@ -98,7 +101,7 @@ const lines = (stream: NodeJS.ReadableStream) => { |
98 | 101 | }; |
99 | 102 |
|
100 | 103 | describe("renderCliShim", () => { |
101 | | - it.each(["SIGTERM", "SIGHUP"] as const)( |
| 104 | + it.skipIf(!hasSetsid).each(["SIGTERM", "SIGHUP"] as const)( |
102 | 105 | "keeps the AppImage mounted until the server exits after %s to the process group", |
103 | 106 | async (signal) => { |
104 | 107 | const { root, shim } = fakeAppImage(true, SLOW_SERVER); |
@@ -117,8 +120,8 @@ describe("renderCliShim", () => { |
117 | 120 |
|
118 | 121 | // Ctrl-C in a terminal, a closed SSH session, or a service manager signals the whole group. |
119 | 122 | process.kill(-child.pid!, signal); |
120 | | - // The shell runs pending traps in signal order, so a mounter that also got the group |
121 | | - // signal unmounts before it can answer this probe. |
| 123 | + // The shell runs pending traps in ascending signal number, and WINCH outnumbers TERM and |
| 124 | + // HUP, so a mounter that also got the group signal unmounts before it answers this probe. |
122 | 125 | process.kill(mounter, "SIGWINCH"); |
123 | 126 | const mount = await events.until((line) => line === "mounted" || line === "unmounted"); |
124 | 127 | expect(mount).toBe("mounted"); |
|