Repository navigation
test(files): give oversized PDF extraction time under load - #147
Merged
Merged
Conversation
The text-limit test and workerErrorExit allowed 5 s. Under a loaded parallel suite the 180-page extraction ran past that and returned "PDF extraction timed out", or tripped the helper's own timer, so the test failed although the text limit worked. Both now allow 30 s, and the test 60 s.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extractPdfText > worker text limit fails without a timeoutnow allows 30 s for each oversized PDF extraction instead of 5 s, and 60 s for the whole test instead of 15 s.workerErrorExit, which has its own guard timer, uses the sameSLOW_WORKER_MSconstant. The other tests' 5 s limits are unchanged; they extract small fixtures.Why
The test checks that the text limit stops a 180-page PDF before any timeout. Under a loaded parallel suite, the extraction itself took longer than 5 s, so the test failed although the text limit worked:
runPdfExtractionreturned"PDF extraction timed out"instead of"PDF extraction failed"(line 136).workerErrorExit's 5 s guard fired instead (expect(timedOut).toBe(false), line 67).It failed in 2 of 3 local pre-push runs and blocked a push of #146. CI on
mainpassed.Evidence
Load reproduction: 16 copies of the test running at once (
bun test apps/server/src/files/pdf-text.test.ts -t "worker text limit fails without a timeout"), on the same machine:main(5 s / 5 s)"PDF extraction timed out"workerErrorExit5 sworkerErrorExitAlone, the test still takes about 3.5 s.
bun run checkpasses: 1316 tests, 0 failing.Risk and rollback
Reversibility: Reversible.
Blast radius: One test file; no production code changes.
If extraction ever really hangs, the test now takes up to 60 s to fail instead of 15 s.