Skip to content

test(web): raise imageCompression ladder test timeout for slow runners - #5416

Open
snowykr wants to merge 1 commit into
pingdotgg:mainfrom
snowykr:test-imagecompression-timeout
Open

test(web): raise imageCompression ladder test timeout for slow runners#5416
snowykr wants to merge 1 commit into
pingdotgg:mainfrom
snowykr:test-imagecompression-timeout

Conversation

@snowykr

@snowykr snowykr commented Aug 5, 2026

Copy link
Copy Markdown

What Changed

Speed up the imageCompression.test.ts case "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_000 chars) to compressImageForStash, 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. The 60_000 timeout 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

  • Local targeted run: changed test ~0.9s; 12/12 tests in the file pass.
  • vp lint, vp fmt --check, and tsgo --noEmit for apps/web are clean.
  • Fork CI (ubuntu-latest, 2-vCPU GitHub-hosted runners) was previously failing 3/3 with Test timed out in 15000ms on 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 compressImageForStash with an explicit 150_000 character budget so every encode still exceeds the cap and the same too-large + close give-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.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 63e06362-ca35-4a4d-b371-98717128c53f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 5, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 5, 2026
@snowykr
snowykr force-pushed the test-imagecompression-timeout branch from f956df9 to de5988a Compare August 6, 2026 10:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/web/src/lib/imageCompression.test.ts Outdated
@snowykr
snowykr force-pushed the test-imagecompression-timeout branch from de5988a to 19f78dd Compare August 6, 2026 10:34
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 6, 2026 10:34

Dismissing prior approval to re-evaluate 19f78dd

@snowykr
snowykr force-pushed the test-imagecompression-timeout branch from 19f78dd to 177c50c Compare August 6, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant