Unverified Commit 1db1762a authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[test] Deflake prerender suite (#85563)

Co-authored-by: 's avatarZack Tanner <1939140+ztanner@users.noreply.github.com>
parent cac2dd80
......@@ -371,19 +371,19 @@ describe('Prerender', () => {
const navigateTest = (isDev = false) => {
it('should navigate between pages successfully', async () => {
const toBuild = [
'/',
'/another',
'/something',
'/normal',
'/blog/post-1',
'/blog/post-1/comment-1',
'/catchall/first',
// TODO: Compiling this many pages in parallel hits some race condition
// causing "SyntaxError: Unexpected non-whitespace character after JSON at position 614"
// which persists throughout Next.js Server instance lifetime.
// Compiling in batches to avoid that unknown bug.
const toBuildBatches = [
['/', '/another', '/something', '/normal'],
['/blog/post-1', '/blog/post-1/comment-1', '/catchall/first'],
]
await waitFor(2500)
await Promise.all(toBuild.map((pg) => renderViaHTTP(next.url, pg)))
for (const toBuild of toBuildBatches) {
// eslint-disable-next-line no-loop-func -- we're not accessing `next` after the loop was exited.
await Promise.all(toBuild.map((pg) => renderViaHTTP(next.url, pg)))
}
const browser = await webdriver(next.url, '/')
let text = await browser.elementByCss('p').text()
......
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