From 12ba37d0f4e515842849a59cc59021ed6eb06dc8 Mon Sep 17 00:00:00 2001 From: Ankit Ranjan Date: Mon, 10 Aug 2026 23:53:41 +0530 Subject: [PATCH] test: stop the oversized-file guard test writing 31 MB for real MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test allocated and wrote a real 31 MB buffer to a temp dir just to give the size guard something over its 30 MB limit. On Windows CI that write alone can exceed the 5s default timeout — it failed the push run of 4eb9c549 while the identical pull_request run passed. The guard only reads stats.size, so truncate an empty file to the same length instead: same assertion, sparse file, no bulk write. Co-Authored-By: Claude Opus 5 --- plugins/claude/test/utils.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/claude/test/utils.test.js b/plugins/claude/test/utils.test.js index 3e44de98..ab77ebeb 100644 --- a/plugins/claude/test/utils.test.js +++ b/plugins/claude/test/utils.test.js @@ -82,7 +82,10 @@ describe('claude sendWithFile', () => { const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'webcmd-claude-')); tempDirs.push(dir); const filePath = path.join(dir, 'big.bin'); - fs.writeFileSync(filePath, Buffer.alloc(31 * 1024 * 1024)); + // Sparse: the guard only reads stats.size, and writing 31 MB for real + // timed out the 5s default on Windows CI. + fs.writeFileSync(filePath, ''); + fs.truncateSync(filePath, 31 * 1024 * 1024); const page = { setFileInput: vi.fn(), evaluate: vi.fn(), wait: vi.fn() }; const result = await sendWithFile(page, filePath, 'hi');