fix(e2e): report signaled host server startups · openclaw/openclaw@48b338a
vincentkoc
·
2026-06-20
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -557,6 +557,42 @@ exit 42
|
557 | 557 | }, |
558 | 558 | ); |
559 | 559 | |
| 560 | +it.runIf(process.platform !== "win32")( |
| 561 | +"reports signaled host artifact server startup exits immediately", |
| 562 | +async () => { |
| 563 | +const tempDir = mkdtempSync(join(tmpdir(), "openclaw-parallels-host-server-signal-")); |
| 564 | +const fakePython = join(tempDir, "python3"); |
| 565 | +writeFileSync( |
| 566 | +fakePython, |
| 567 | +`#!/usr/bin/env bash |
| 568 | +kill -TERM "$$" |
| 569 | +`, |
| 570 | +); |
| 571 | +chmodSync(fakePython, 0o755); |
| 572 | + |
| 573 | +try { |
| 574 | +const port = await unusedLoopbackPort(); |
| 575 | +const result = spawnNodeEvalSync( |
| 576 | +`import { startHostServer } from "./${TS_PATHS.hostServer}"; await startHostServer({ dir: ".", hostIp: "127.0.0.1", port: ${port}, artifactPath: "artifact.tgz", label: "artifact" });`, |
| 577 | +{ |
| 578 | +env: { |
| 579 | + ...process.env, |
| 580 | +PATH: `${tempDir}${delimiter}${process.env.PATH ?? ""}`, |
| 581 | +}, |
| 582 | +imports: ["tsx"], |
| 583 | +maxBuffer: 1024 * 1024, |
| 584 | +}, |
| 585 | +); |
| 586 | + |
| 587 | +expect(result.status).toBe(1); |
| 588 | +expect(result.stderr).toContain("host artifact server exited early: signal SIGTERM"); |
| 589 | +expect(result.stderr).not.toContain("did not start"); |
| 590 | +} finally { |
| 591 | +rmSync(tempDir, { force: true, recursive: true }); |
| 592 | +} |
| 593 | +}, |
| 594 | +); |
| 595 | + |
560 | 596 | it("quotes shell args and resolves fuzzy snapshot hints through the shared TypeScript helper", () => { |
561 | 597 | const tempDir = mkdtempSync(join(tmpdir(), "openclaw-parallels-helper-")); |
562 | 598 | writeFakePrlctl( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。