test: harden parallels smoke harness

This commit is contained in:
Peter Steinberger
2026-04-22 21:59:59 +01:00
parent 054fda206e
commit 2e38e09b04
9 changed files with 598 additions and 236 deletions

View File

@@ -193,6 +193,7 @@ const { defaultRuntime } = await import("../runtime.js");
const { updateCommand, updateStatusCommand, updateWizardCommand } = await import("./update-cli.js");
const updateCliShared = await import("./update-cli/shared.js");
const { resolveGitInstallDir } = updateCliShared;
const { spawnSync } = await import("node:child_process");
type UpdateCliScenario = {
name: string;
@@ -458,6 +459,19 @@ describe("update-cli", () => {
setStdoutTty(false);
});
it("bounds completion cache refresh during update follow-up", async () => {
const root = createCaseDir("openclaw-completion-timeout");
pathExists.mockResolvedValue(true);
await updateCliShared.tryWriteCompletionCache(root, false);
expect(spawnSync).toHaveBeenCalledWith(
expect.any(String),
[path.join(root, "openclaw.mjs"), "completion", "--write-state"],
expect.objectContaining({ timeout: 30_000 }),
);
});
it("respawns into the updated package root before running post-update tasks", async () => {
const { entrypoints } = setupUpdatedRootRefresh();