From ebc8fc1f4e05c1ae6c6f83d870b76b344a9de277 Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Tue, 3 Feb 2026 10:02:02 -0800 Subject: [PATCH] Fix tests --- apps/backend/src/app/health/email/route.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/app/health/email/route.tsx b/apps/backend/src/app/health/email/route.tsx index 5cd5a9def..b317ed42f 100644 --- a/apps/backend/src/app/health/email/route.tsx +++ b/apps/backend/src/app/health/email/route.tsx @@ -107,7 +107,7 @@ const waitForVerificationEmail = async (testEmail: string, useInbucket: boolean) const POLL_INTERVAL_MS = 5000; for (let attempt = 1; attempt <= MAX_POLL_ATTEMPTS; attempt++) { - await traceSpan(`waiting for verification email - attempt ${attempt}`, async () => { + const done = await traceSpan(`waiting for verification email - attempt ${attempt}`, async () => { await wait(POLL_INTERVAL_MS); const listData = useInbucket @@ -118,9 +118,14 @@ const waitForVerificationEmail = async (testEmail: string, useInbucket: boolean) const verificationEmail = emails.find((email) => isExpectedVerificationEmail(email, testEmail)); if (verificationEmail) { - return; + return true; } + + return false; }); + if (done) { + return; + } } throw new StackAssertionError(`Couldn't find verification email in time limit`, { recipient_email: testEmail, max_poll_attempts: MAX_POLL_ATTEMPTS, poll_interval_ms: POLL_INTERVAL_MS });