Skip to content

test(azure): shrink image generation fixture from 6.9MB to 12.6KB#13486

Merged
gr2m merged 2 commits intomainfrom
gr2m/shrink-azure-image-fixture
Mar 16, 2026
Merged

test(azure): shrink image generation fixture from 6.9MB to 12.6KB#13486
gr2m merged 2 commits intomainfrom
gr2m/shrink-azure-image-fixture

Conversation

@gr2m
Copy link
Copy Markdown
Collaborator

@gr2m gr2m commented Mar 16, 2026

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.

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

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>
@tigent tigent bot added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label maintenance CI, internal documentation, automations, etc provider/azure Issues related to the @ai-sdk/azure provider labels Mar 16, 2026
@gr2m gr2m added the backport Admins only: add this label to a pull request in order to backport it to the prior version label Mar 16, 2026
## 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>
@gr2m gr2m merged commit 9c26db8 into main Mar 16, 2026
18 checks passed
@gr2m gr2m deleted the gr2m/shrink-azure-image-fixture branch March 16, 2026 18:28
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>
@vercel-ai-sdk vercel-ai-sdk bot removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label Mar 16, 2026
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Mar 16, 2026

✅ Backport PR created: #13488

vercel-ai-sdk bot added a commit that referenced this pull request Mar 16, 2026
…12.6KB (#13488)

This is an automated backport of #13486 to the release-v6.0 branch. FYI
@gr2m

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label maintenance CI, internal documentation, automations, etc provider/azure Issues related to the @ai-sdk/azure provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants