Skip to content

test: stop the oversized-file guard test writing 31 MB for real - #268

Open
ankitranjan7 wants to merge 1 commit into
mainfrom
fix/flaky-oversized-file-test
Open

test: stop the oversized-file guard test writing 31 MB for real#268
ankitranjan7 wants to merge 1 commit into
mainfrom
fix/flaky-oversized-file-test

Conversation

@ankitranjan7

Copy link
Copy Markdown
Contributor

Fixes the Windows CI flake seen on #267.

plugins/claude/test/utils.test.js allocated and wrote a real 31 MB buffer to a temp dir just to give sendWithFile's size guard something over its 30 MB limit. On a slow Windows runner that write alone can blow the 5 s default timeout:

FAIL  plugin  plugins/claude/test/utils.test.js > claude sendWithFile > rejects oversized files before any upload attempt
Error: Test timed out in 5000ms.

It is a flake, not a regression — commit 4eb9c549 failed this job in its push run (31402668177) and passed the same job in its pull_request run (31402676413).

The guard only reads stats.size (plugins/claude/utils.js:378), so truncating an empty file to 31 MB gives the same assertion with no bulk write.

Verification

npx vitest run plugins/claude/test/utils.test.js → 12 passed, test time 5 ms (was dominated by the write). The /too large/ assertion still fires, so the file really is over the limit.

🤖 Generated with Claude Code

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 4eb9c54 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 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🟢 No documentation gap found — high confidence

The pull request only changes tests, lockfiles, generated metadata, or dependency metadata.

This review is advisory and does not block merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant