mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:00:43 +00:00
test(ci): stabilize release validation flakes
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user