fix(e2e): force Windows smoke gateway stop

This commit is contained in:
Vincent Koc
2026-07-29 00:27:25 +08:00
parent 1e6ace20bd
commit 6e275bf0b4
2 changed files with 8 additions and 1 deletions

View File

@@ -696,11 +696,12 @@ Invoke-OpenClaw update status --json`,
}
private gatewayAction(action: "restart" | "stop"): Promise<void> {
const forceFlag = action === "stop" ? " --force" : "";
return this.guestPowerShellBackground(
`gateway-${action}`,
`$ErrorActionPreference = 'Continue'
$PSNativeCommandUseErrorActionPreference = $false
Invoke-OpenClaw gateway ${action}
Invoke-OpenClaw gateway ${action}${forceFlag}
if ($LASTEXITCODE -ne 0) { throw "gateway ${action} failed with exit code $LASTEXITCODE" }`,
420_000,
);

View File

@@ -306,6 +306,12 @@ describe("Parallels smoke model selection", () => {
expect(linux).toContain("rm -rf /root/.openclaw /root/.npm/_cacache");
});
it("forces the explicit test-owned Windows gateway stop", () => {
const windows = readFileSync(TS_PATHS.windows, "utf8");
expect(windows).toContain('const forceFlag = action === "stop" ? " --force" : "";');
expect(windows).toContain("Invoke-OpenClaw gateway ${action}${forceFlag}");
});
it("preserves caller arguments when loaded as the Windows controller library", () => {
const result = spawnSync(
"bash",