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. No code changes detected at 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
177c50c to
6849430
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 fixture change; no production or assertion semantics change.
Overview
The "reports too-large when even the smallest encoding overflows the budget" case in
imageCompression.test.tsno longer simulates 8 MB encodes on every ladder step. The canvas stub now returns 300 KB blobs, and the test callscompressImageForStashwith an explicit 150_000 character budget so every step still overflows and the same too-large + bitmap close behavior is asserted.This cuts per-run base64 work from ~120 MB to a few MB so the test stays under the default 15s timeout on 2-vCPU GitHub runners without a raised timeout. Production code is unchanged; only the test fixture and optional budget argument differ.
Reviewed by Cursor Bugbot for commit 6849430. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Reduce encoded sizes in
compressImageForStashladder test to avoid timeout on slow runnersThe stubbed encoder in the "reports too-large when even the smallest encoding overflows the budget" test previously returned 8,000,000 bytes, causing timeouts on slow CI runners. It now returns 300,000 bytes, and
compressImageForStashis called with an explicit 150,000-byte budget, keeping the{ ok: false, reason: "too-large" }assertion intact without generating large payloads.Macroscope summarized 6849430.