test(preview): ride out image-search 408 overload in the image-feed spec (#2503)

image.getInfinite (meili-backed via the shared feeds-proxy) intermittently returns
HTTP 408 'Image search is temporarily overloaded — please retry' under concurrent
preview-build load — the same flaky search path the #2495 resilience fix addressed
for whatIf + /moderator/images, but the image-feed spec was missed. It hard-failed
an unrelated PR (#2501). Wrap the getInfinite query in retryFlaky (spaced backoff)
so a transient overload is ridden out; honest — a sustained overload still fails.
The app's own 408 message explicitly says to retry.
This commit is contained in:
Zachary Lowden
2026-06-13 07:58:41 -05:00
committed by GitHub
parent 062cb7b862
commit fc63831d2c
+11 -4
View File
@@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test';
import { storageStatePath } from './preview-fixtures';
import { trpcQuery } from './preview-trpc';
import { retryFlaky } from './preview-retry';
/**
* Image-feed content smoke: the real /images browse feed actually renders content.
@@ -57,10 +58,16 @@ test.describe('images browse feed renders real content (tester)', () => {
// background traffic never idles, so a networkidle nav hangs to timeout.
await page.goto('/', { waitUntil: 'domcontentloaded' });
const data = await trpcQuery<{ items: Array<{ id: number }> }>(
page.request,
'image.getInfinite',
{ limit: FEED_LIMIT }
// image.getInfinite is meili-backed via the shared in-cluster feeds-proxy, which
// intermittently returns HTTP 408 ("Image search is temporarily overloaded —
// please retry") under concurrent preview-build load. The app's own error tells
// us to retry; Playwright's whole-test retries fire within seconds (all <5s) so
// they don't outlast the overload. retryFlaky spaces the retries with backoff to
// ride it out — honest: a sustained overload still fails after the attempts.
const data = await retryFlaky('image.getInfinite feed', () =>
trpcQuery<{ items: Array<{ id: number }> }>(page.request, 'image.getInfinite', {
limit: FEED_LIMIT,
})
);
const items = data?.items ?? [];