





















@@ -245,6 +245,34 @@ describe("release user journey assertions", () => {
245245}
246246});
247247248+it("rejects loose HTTP timeout env values instead of parsing prefixes", async () => {
249+const root = mkdtempSync(path.join(tmpdir(), "openclaw-release-user-assertions-"));
250+const home = path.join(root, "home");
251+const portPath = path.join(root, "port.txt");
252+const server = startTcpFixture(
253+portPath,
254+'(socket) => socket.write("HTTP/1.1 200 OK\\r\\nContent-Type: application/json\\r\\n\\r\\n")',
255+);
256+257+try {
258+const port = Number.parseInt((await waitForFile(portPath)).trim(), 10);
259+const result = runAssertion(
260+home,
261+["wait-clickclack-socket", `http://127.0.0.1:${port}`, "1"],
262+{
263+env: { OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "100ms" },
264+timeoutMs: 500,
265+},
266+);
267+268+expect(result.error).toMatchObject({ code: "ETIMEDOUT" });
269+expect(result.signal).toBe("SIGKILL");
270+} finally {
271+await stopChild(server);
272+rmSync(root, { force: true, recursive: true });
273+}
274+});
275+248276it("bounds ClickClack fixture error response bodies", async () => {
249277const root = mkdtempSync(path.join(tmpdir(), "openclaw-release-user-assertions-"));
250278const home = path.join(root, "home");
@@ -283,4 +311,43 @@ describe("release user journey assertions", () => {
283311rmSync(root, { force: true, recursive: true });
284312}
285313});
314+315+it("rejects loose body byte env values instead of parsing prefixes", async () => {
316+const root = mkdtempSync(path.join(tmpdir(), "openclaw-release-user-assertions-"));
317+const home = path.join(root, "home");
318+const portPath = path.join(root, "port.txt");
319+const server = startTcpFixture(
320+portPath,
321+[
322+"(socket) => {",
323+' const body = "x".repeat(128);',
324+" socket.end(`HTTP/1.1 500 Internal Server Error\\r\\nContent-Type: text/plain\\r\\nContent-Length: ${Buffer.byteLength(body)}\\r\\n\\r\\n${body}`);",
325+"}",
326+].join("\n"),
327+);
328+329+try {
330+const port = Number.parseInt((await waitForFile(portPath)).trim(), 10);
331+const result = runAssertion(
332+home,
333+["post-clickclack-inbound", `http://127.0.0.1:${port}`, "hello"],
334+{
335+env: {
336+OPENCLAW_RELEASE_USER_JOURNEY_HTTP_BODY_MAX_BYTES: "16bytes",
337+OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "1000",
338+},
339+timeoutMs: 2500,
340+},
341+);
342+343+expect(result.error).toBeUndefined();
344+expect(result.signal).not.toBe("SIGKILL");
345+expect(result.status).not.toBe(0);
346+expect(result.stderr).toContain("fixture inbound failed: 500");
347+expect(result.stderr).not.toContain("response body exceeded 16 bytes");
348+} finally {
349+await stopChild(server);
350+rmSync(root, { force: true, recursive: true });
351+}
352+});
286353});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。