test(azure): shrink image generation fixture from 6.9MB to 12.6KB#13486
Merged
test(azure): shrink image generation fixture from 6.9MB to 12.6KB#13486
Conversation
Replace full-size raccoon PNG (1.7MB, repeated 3x as base64) with a minimal 1x1 pixel PNG in the test fixture. This reduces the fixture from 6.9MB to 12.6KB and speeds up the streaming image generation test significantly (171ms → 2ms locally, ~10s → ~3s in CI). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dancer
approved these changes
Mar 16, 2026
4 tasks
## Background The Azure provider's image generation test fixtures contained a full 1.7MB cartoon raccoon PNG encoded as base64. This appeared in three places: the streaming chunks fixture (6.9MB), the JSON fixture (2.1MB), and the resulting snapshot (2.3MB), totaling ~11.3MB of unnecessary data. The tests only validate streaming behavior and response structure, not image content. Follow-up to #13486 which only addressed the chunks fixture. ## Summary - Replaced full-size base64 PNG with a minimal 1x1 pixel PNG (69 bytes) in both `azure-image-generation-tool.1.chunks.txt` and `azure-image-generation-tool.1.json` - Updated corresponding snapshots | File | Before | After | |---|---|---| | `azure-image-generation-tool.1.chunks.txt` | 6.9 MB | 12.6 KB | | `azure-image-generation-tool.1.json` | 2.1 MB | 1.7 KB | | `azure-openai-provider.test.ts.snap` | 2.3 MB | 200 KB | | **Total** | **~11.3 MB** | **~214 KB** | Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
vercel-ai-sdk bot
pushed a commit
that referenced
this pull request
Mar 16, 2026
…3486) ## Background The Azure provider's image generation test fixtures contained a full 1.7MB cartoon raccoon PNG encoded as base64. This appeared in three places: the streaming chunks fixture (6.9MB), the JSON fixture (2.1MB), and the resulting snapshot (2.3MB), totaling ~11.3MB. The tests only validate streaming behavior and response structure, not image content, so the actual image payload is irrelevant. In CI (Node 22), the `should stream image generation tool results include` test was taking **3–10 seconds** due to parsing and streaming this data, compared to ~1–14ms for every other test in the file. ## Summary - Replaced full-size base64 PNG with a minimal 1x1 pixel PNG (69 bytes) in both `azure-image-generation-tool.1.chunks.txt` and `azure-image-generation-tool.1.json` - Updated corresponding test snapshots | File | Before | After | |---|---|---| | `azure-image-generation-tool.1.chunks.txt` | 6.9 MB | 12.6 KB | | `azure-image-generation-tool.1.json` | 2.1 MB | 1.7 KB | | `azure-openai-provider.test.ts.snap` | 2.3 MB | 200 KB | | **Total** | **~11.3 MB** | **~214 KB** | ## Manual Verification All 55 tests in `azure-openai-provider.test.ts` pass on both node and edge configurations. The target test went from 171ms to 2ms locally. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
✅ Backport PR created: #13488 |
4 tasks
gr2m
added a commit
that referenced
this pull request
Mar 16, 2026
…#13489) ## Background PR #13483 added a 6s timeout to the `should stream image generation tool results include` test because the large fixture (6.9MB of base64 image data) caused it to exceed the default 5s timeout in CI. PR #13486 fixed the root cause by replacing the large image with a minimal 1x1 pixel PNG, reducing the fixture from 6.9MB to 12.6KB. The test now runs in ~2ms locally, so the extended timeout is no longer needed. ## Summary Reverts #13483 to remove the 6s timeout and restore the original test structure. ## Related Issues - Reverts #13483 - Follow-up to #13486
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.
Background
The Azure provider's image generation test fixtures contained a full 1.7MB cartoon raccoon PNG encoded as base64. This appeared in three places: the streaming chunks fixture (6.9MB), the JSON fixture (2.1MB), and the resulting snapshot (2.3MB), totaling ~11.3MB. The tests only validate streaming behavior and response structure, not image content, so the actual image payload is irrelevant.
In CI (Node 22), the
should stream image generation tool results includetest was taking 3–10 seconds due to parsing and streaming this data, compared to ~1–14ms for every other test in the file.Summary
azure-image-generation-tool.1.chunks.txtandazure-image-generation-tool.1.jsonazure-image-generation-tool.1.chunks.txtazure-image-generation-tool.1.jsonazure-openai-provider.test.ts.snapManual Verification
All 55 tests in
azure-openai-provider.test.tspass on both node and edge configurations. The target test went from 171ms to 2ms locally.Checklist
pnpm changesetin the project root)