fix(test-utils): bump waitFor default timeout to 10s

Under full `just test-all` load the Phoenix socket can take a beat to
propagate a new subscription's filter to the backend before a mutation
fires, so R-01 occasionally timed out at 5s. Passing runs still resolve
instantly on event arrival — this only widens the flake window.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 11:45:54 +02:00
parent 104eeba02e
commit 3afc911cfc

View File

@@ -73,7 +73,10 @@ export async function subscribePostgresChanges<T = Record<string, unknown>>(
function waitFor( function waitFor(
predicate: (e: { eventType: string; new: T; old: T | null }) => boolean, predicate: (e: { eventType: string; new: T; old: T | null }) => boolean,
timeoutMs = 5_000 // 10s default: under load (full `just test-all`), the Phoenix socket can take
// a beat to propagate a fresh subscription's filter before the mutation fires.
// Passing runs resolve immediately on event arrival — this only bounds the flake.
timeoutMs = 10_000
) { ) {
const existing = events.find(predicate); const existing = events.find(predicate);
if (existing) return Promise.resolve(existing); if (existing) return Promise.resolve(existing);