Unverified Commit bbe2786b authored by Hendrik Liebau's avatar Hendrik Liebau Committed by GitHub

Unflake `segment cache (CDN cache busting)` redirect test (#80967)

parent 8c153021
......@@ -375,6 +375,24 @@ Choose a more specific substring to assert on.
await browserResponse.finished()
}
}
if (fulfilled.status === 307 || fulfilled.status === 308) {
// If this was a redirect, give the browser time to follow the
// redirect, before continuing. We do that by waiting for the very
// next request to respond. Otherwise, we might exit early, before
// the request was added to the pending requests set.
await new Promise<void>((resolve) => {
page.once('request', (req) => {
const handleResponse = (res: Playwright.Response) => {
if (res.url() === req.url()) {
page.off('response', handleResponse)
resolve()
}
}
page.on('response', handleResponse)
})
})
}
}
// After flushing the queue, wait for the microtask queue to be
......
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