From 3afc911cfc1c839e970840c55ccde058dae61fd0 Mon Sep 17 00:00:00 2001 From: Oier Bravo Urtasun Date: Mon, 13 Apr 2026 11:45:54 +0200 Subject: [PATCH] fix(test-utils): bump waitFor default timeout to 10s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- packages/test-utils/src/realtime-helpers.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/test-utils/src/realtime-helpers.ts b/packages/test-utils/src/realtime-helpers.ts index fe4b1da..f470f00 100644 --- a/packages/test-utils/src/realtime-helpers.ts +++ b/packages/test-utils/src/realtime-helpers.ts @@ -73,7 +73,10 @@ export async function subscribePostgresChanges>( function waitFor( 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); if (existing) return Promise.resolve(existing);