test(web): raise imageCompression ladder test timeout for slow runners - #5416
test(web): raise imageCompression ladder test timeout for slow runners#5416snowykr wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved 19f78dd Test-only change that reduces stub payload sizes in imageCompression.test.ts to improve test performance on slow runners. No production code is affected. You can customize Macroscope's approvability policy. Learn more. |
f956df9 to
de5988a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de5988ab03
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
de5988a to
19f78dd
Compare
Dismissing prior approval to re-evaluate 19f78dd
19f78dd to
177c50c
Compare
What Changed
Speed up the
imageCompression.test.tscase "reports too-large when even the smallest encoding overflows the budget" so it completes within the default 15s per-test timeout instead of relying on a raised timeout.Previously the stub returned an 8 MB blob for every ladder step (3 fallback scales × [probe + 4 quality steps] = 15 encodes), materializing and base64-encoding ~120 MB per run — ~41s on 2-vCPU GitHub-hosted runners, failing with
Test timed out in 15000ms. The 8-vCPU blacksmith runners used in this repo are fast enough that it stayed under 15s, so the failure only surfaced on slower machines.Now the stub returns a 300 KB blob and the test passes an explicit small budget (
150_000chars) tocompressImageForStash, so every encode still overflows the budget and the give-up path (too-large + bitmap release) runs exactly as before — but the base64 work drops to ~4.5 MB (15 × 300 KB) plus the one-time 9 MB source encode. The60_000timeout override is removed.No production code, stubs, payloads, or assertions change — the test's semantics are untouched.
Why
Test-robustness only: keep the ladder's give-up behavior fully exercised on slow CI runners without paying for multi-megabyte base64 payloads on every quality step (AGENTS.md "Performance without compromise").
Validation
vp lint,vp fmt --check, andtsgo --noEmitforapps/webare clean.Test timed out in 15000mson the old fixture.Related work
Complements #5220 (perf(web): skip base64 for oversized image candidates), which fixes the underlying slowness in the source by skipping base64 for candidates that already exceed the budget.
UI Changes
N/A — test-only change, no UI.
Note
Low Risk
Test-only change; no production code or assertion semantics changed.
Overview
Makes the "reports too-large when even the smallest encoding overflows the budget" case finish reliably under the default Vitest timeout on slow CI runners, without changing what the test proves.
The canvas stub now returns 300 KB blobs instead of 8 MB on every ladder step, and the test calls
compressImageForStashwith an explicit150_000character budget so every encode still exceeds the cap and the same too-large +closegive-up path runs. Comments document that the smaller budget is test-only to avoid materializing huge base64 payloads per quality step.Reviewed by Cursor Bugbot for commit 177c50c. Bugbot is set up for automated code reviews on this repo. Configure here.