Apply 15s timeout to subscription limit tests#521
Conversation
Why: active tests in the Subscription limit enforcement block lacked the bumped timeout that the file's own comment said was needed, so the block grant test flaked at Bun's 5s boundary. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Greptile SummaryThis PR fixes test flakiness by applying the existing
Confidence Score: 4/5Safe to merge, but two active tests in the same block still lack the 15 s timeout and will continue to flake on loaded machines. The change is a no-risk test-only fix that resolves the reported flake for 5 tests. However, 2 of the 7 active tests in the block are missing the timeout, leaving them open to the exact same category of failure. web/src/app/api/v1/chat/completions/tests/completions.test.ts — two active tests at lines 1119 and 1155 are missing SUBSCRIPTION_TEST_TIMEOUT_MS Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Subscription limit enforcement\ndescribe block\n(7 active tests)"] --> B["Tests with 15s timeout applied ✅\n(lines 804, 838, 885, 919, 950)"]
A --> C["Tests still using default 5s timeout ⚠️\n(lines 1119, 1155)"]
B --> D["SUBSCRIPTION_TEST_TIMEOUT_MS = 15000"]
C --> E["Bun default = 5000ms\n→ potential flake on loaded machines"]
|
Summary
continues when block grant is created successfullytest incompletions.test.tsflaked and failed at 5001ms — Bun's default 5s timeout.SUBSCRIPTION_TEST_TIMEOUT_MS = 15000with a comment noting these non-streaming fetch-path tests flake at the boundary, but only the.skipped tests had it applied.Subscription limit enforcementblock.Test plan
bun test src/app/api/v1/chat/completions/__tests__/completions.test.tspasses (24 pass, 4 skip, 0 fail)🤖 Generated with Claude Code