Unverified Commit 7f5bc717 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update flakey relay analytics test (#39877)

Implements `check` on relay analytics test as the timing can be indeterminate. 

Fixes: https://github.com/vercel/next.js/runs/7979410199?check_suite_focus=true#step:9:230
parent ec25b474
...@@ -117,9 +117,15 @@ function runTest() { ...@@ -117,9 +117,15 @@ function runTest() {
) )
// INP metric is only reported on pagehide or visibilitychange event, so refresh the page // INP metric is only reported on pagehide or visibilitychange event, so refresh the page
await browser.refresh() await browser.refresh()
const INP = parseInt(await browser.eval('localStorage.getItem("INP")'), 10) await check(async () => {
// We introduced a delay of 100ms, so INP duration should be >= 100 const INP = parseInt(
expect(INP).toBeGreaterThanOrEqual(100) 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() await browser.close()
}) })
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment