@@ -111,6 +111,7 @@ function writeFakePrlctl(tempDir: string, posixScript: string, windowsBootstrap:
|
111 | 111 | |
112 | 112 | class FakeHostServerChild extends EventEmitter { |
113 | 113 | exitCode: number | null = null; |
| 114 | +signalCode: NodeJS.Signals | null = null; |
114 | 115 | readonly signals: string[] = []; |
115 | 116 | |
116 | 117 | kill(signal?: NodeJS.Signals | number): boolean { |
@@ -122,6 +123,11 @@ class FakeHostServerChild extends EventEmitter {
|
122 | 123 | this.exitCode = 0; |
123 | 124 | this.emit("exit", 0, null); |
124 | 125 | } |
| 126 | + |
| 127 | +exitWithSignal(signal: NodeJS.Signals): void { |
| 128 | +this.signalCode = signal; |
| 129 | +this.emit("exit", null, signal); |
| 130 | +} |
125 | 131 | } |
126 | 132 | |
127 | 133 | async function unusedLoopbackPort(): Promise<number> { |
@@ -413,6 +419,16 @@ describe("Parallels smoke model selection", () => {
|
413 | 419 | } |
414 | 420 | }); |
415 | 421 | |
| 422 | +it("treats signaled host artifact server children as already exited", async () => { |
| 423 | +const child = new FakeHostServerChild(); |
| 424 | +child.exitWithSignal("SIGTERM"); |
| 425 | + |
| 426 | +await expect(hostServerTesting.stopHostServerChild(child as never, 100, 100)).resolves.toBe( |
| 427 | +true, |
| 428 | +); |
| 429 | +expect(child.signals).toEqual([]); |
| 430 | +}); |
| 431 | + |
416 | 432 | it("uses a temporary npmrc file and cleans it after resolving the latest package version", () => { |
417 | 433 | const tempRoot = mkdtempSync(join(tmpdir(), "openclaw-parallels-version-")); |
418 | 434 | let userConfigPath = ""; |
|