






























@@ -2877,6 +2877,41 @@ describe("update-cli", () => {
28772877expect(updateCall?.beforeGitMutation).toEqual(expect.any(Function));
28782878});
287928792880+it("fails managed git restart when the gateway responds but the service stays stopped", async () => {
2881+const serviceEntrypoint = path.join(process.cwd(), "dist", "index.js");
2882+serviceReadCommand.mockResolvedValue({
2883+programArguments: ["node", serviceEntrypoint, "gateway", "run"],
2884+environment: {
2885+OPENCLAW_SERVICE_MARKER: "openclaw",
2886+OPENCLAW_SERVICE_KIND: "gateway",
2887+},
2888+});
2889+serviceLoaded.mockResolvedValue(false);
2890+serviceLoaded.mockResolvedValueOnce(true);
2891+serviceReadRuntime.mockResolvedValue({
2892+status: "stopped",
2893+pid: null,
2894+state: "stopped",
2895+});
2896+serviceReadRuntime.mockResolvedValueOnce({
2897+status: "running",
2898+pid: 4242,
2899+state: "running",
2900+});
2901+mockGitUpdateAfterMutation();
2902+2903+await updateCommand({ yes: true });
2904+2905+const logs = vi.mocked(defaultRuntime.log).mock.calls.map((call) => String(call[0]));
2906+expect(serviceStop).toHaveBeenCalledTimes(1);
2907+expect(runRestartScript).toHaveBeenCalledTimes(1);
2908+expect(defaultRuntime.exit).toHaveBeenCalledWith(1);
2909+expect(logs.join("\n")).toContain(
2910+"Gateway responded, but the managed service did not report running after restart.",
2911+);
2912+expect(logs.join("\n")).not.toContain("Gateway: restarted and verified.");
2913+});
2914+28802915it("stops a managed gateway rooted at the git checkout when switching package installs to dev", async () => {
28812916const packageRoot = createCaseDir("openclaw-update-package-root");
28822917const gitRoot = await createTrackedTempDir("openclaw-update-git-service-root-");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。