test(ci): stabilize release validation flakes

This commit is contained in:
Peter Steinberger
2026-04-28 23:10:30 +01:00
parent eb970bdb42
commit e583db63c6
2 changed files with 14 additions and 2 deletions

View File

@@ -431,6 +431,16 @@ describe("registerPreActionHooks", () => {
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
});
it("does not preload plugins for remote agent JSON output", async () => {
await runPreAction({
parseArgv: ["agent"],
processArgv: ["node", "openclaw", "agent", "--message", "hi", "--json"],
});
expect(routeLogsToStderrMock).toHaveBeenCalledOnce();
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
});
it("bypasses config guard for config validate", async () => {
await runPreAction({
parseArgv: ["config", "validate"],
@@ -475,7 +485,7 @@ describe("registerPreActionHooks", () => {
await runPreAction({
parseArgv: ["agent"],
processArgv: ["node", "openclaw", "agent", "--message", "hi", "--json"],
processArgv: ["node", "openclaw", "agent", "--local", "--message", "hi", "--json"],
});
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalled();

View File

@@ -4,6 +4,8 @@ import * as net from "node:net";
import { afterEach, describe, expect, it } from "vitest";
import { WebSocketServer } from "ws";
const CHILD_PROCESS_TIMEOUT_MS = process.env.CI ? 30_000 : 10_000;
async function listenOnLoopback(server: Server): Promise<number> {
return new Promise((resolve, reject) => {
server.once("error", reject);
@@ -136,7 +138,7 @@ async function runNodeModule(
const timeout = setTimeout(() => {
child.kill("SIGKILL");
reject(new Error(`child process timed out\nstdout:\n${stdout}\nstderr:\n${stderr}`));
}, 10_000);
}, CHILD_PROCESS_TIMEOUT_MS);
child.on("error", (err) => {
clearTimeout(timeout);