From a8ab1187ca67f59432beed8b655e833f622a4055 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Thu, 17 Sep 2026 23:23:48 -0700 Subject: [PATCH] test(ui): clean up synchronous browser failures --- tests/e2e/ui/helpers/roundTrip.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/e2e/ui/helpers/roundTrip.ts b/tests/e2e/ui/helpers/roundTrip.ts index ee484b8d512..55eb5d6ad9c 100644 --- a/tests/e2e/ui/helpers/roundTrip.ts +++ b/tests/e2e/ui/helpers/roundTrip.ts @@ -37,10 +37,12 @@ export async function runWithCleanup( action: () => Promise, cleanup: () => Promise, ): Promise { - const outcome = await action().then( - () => ({ status: "success" as const }), - (error: unknown) => ({ status: "failure" as const, error }), - ); + const outcome = await Promise.resolve() + .then(action) + .then( + () => ({ status: "success" as const }), + (error: unknown) => ({ status: "failure" as const, error }), + ); try { if (outcome.status === "failure") throw outcome.error; } finally {