From 56c0c2faf2279deb73ca494934defe4ce53bc420 Mon Sep 17 00:00:00 2001 From: Onur Temizkan Date: Fri, 20 Sep 2024 15:13:15 +0300 Subject: [PATCH] fix(test): Unflake LCP test --- .../suites/tracing/metrics/handlers-lcp/test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/handlers-lcp/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/handlers-lcp/test.ts index a2801f4e4016..19ce0458c4ea 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/handlers-lcp/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/handlers-lcp/test.ts @@ -20,11 +20,13 @@ sentryTest( ); const url = await getLocalTestPath({ testDir: __dirname }); - const [eventData] = await Promise.all([ - getFirstSentryEnvelopeRequest(page), - page.goto(url), - page.click('button'), - ]); + + const eventDataPromise = getFirstSentryEnvelopeRequest(page); + + await page.goto(url); + await page.click('button'); + + const eventData = await eventDataPromise; expect(eventData.measurements).toBeDefined(); expect(eventData.measurements?.lcp?.value).toBeDefined();