From 86d9dc8bdfda5d08140c9cb6f169d76a699baa64 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Tue, 23 Aug 2022 13:12:36 -0500 Subject: [PATCH] Update flakey relay analytics test --- test/integration/relay-analytics/test/index.test.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/integration/relay-analytics/test/index.test.js b/test/integration/relay-analytics/test/index.test.js index 2accc97815e83..5ee12ffa9e39a 100644 --- a/test/integration/relay-analytics/test/index.test.js +++ b/test/integration/relay-analytics/test/index.test.js @@ -117,9 +117,15 @@ function runTest() { ) // INP metric is only reported on pagehide or visibilitychange event, so refresh the page await browser.refresh() - const INP = parseInt(await browser.eval('localStorage.getItem("INP")'), 10) - // We introduced a delay of 100ms, so INP duration should be >= 100 - expect(INP).toBeGreaterThanOrEqual(100) + await check(async () => { + const INP = parseInt( + await browser.eval('localStorage.getItem("INP")'), + 10 + ) + // We introduced a delay of 100ms, so INP duration should be >= 100 + expect(INP).toBeGreaterThanOrEqual(100) + return 'success' + }, 'success') await browser.close() }) }