mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 12:26:38 -06:00
fix(e2e): bound release scenario JSON artifacts
This commit is contained in:
@@ -129,6 +129,31 @@ describe("release scenario assertions", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("rejects oversized JSON artifacts before parsing release scenario outputs", () => {
|
||||
const root = mkdtempSync(path.join(tmpdir(), "openclaw-release-scenarios-"));
|
||||
const outputPath = path.join(root, "describe.json");
|
||||
const requestLogPath = path.join(root, "requests.jsonl");
|
||||
|
||||
try {
|
||||
writeFileSync(
|
||||
outputPath,
|
||||
`DO_NOT_DUMP_OLD_JSON${"x".repeat(2 * 1024 * 1024)}\nrecent json tail`,
|
||||
"utf8",
|
||||
);
|
||||
writeFileSync(requestLogPath, "/v1/responses\n", "utf8");
|
||||
|
||||
const result = runAssertion(["assert-image-describe", outputPath, requestLogPath]);
|
||||
|
||||
expect(result.status).not.toBe(0);
|
||||
expect(result.stderr).toContain("JSON artifact exceeded");
|
||||
expect(result.stderr).toContain("recent json tail");
|
||||
expect(result.stderr).not.toContain("DO_NOT_DUMP_OLD_JSON");
|
||||
expect(result.stderr.length).toBeLessThan(80 * 1024);
|
||||
} finally {
|
||||
rmSync(root, { force: true, recursive: true });
|
||||
}
|
||||
});
|
||||
|
||||
it("scans large request logs for image generation requests", () => {
|
||||
const root = mkdtempSync(path.join(tmpdir(), "openclaw-release-scenarios-"));
|
||||
const outputPath = path.join(root, "generate.json");
|
||||
|
||||
Reference in New Issue
Block a user