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', () => { ...@@ -371,19 +371,19 @@ describe('Prerender', () => {
const navigateTest = (isDev = false) => { const navigateTest = (isDev = false) => {
it('should navigate between pages successfully', async () => { it('should navigate between pages successfully', async () => {
const toBuild = [ // TODO: Compiling this many pages in parallel hits some race condition
'/', // causing "SyntaxError: Unexpected non-whitespace character after JSON at position 614"
'/another', // which persists throughout Next.js Server instance lifetime.
'/something', // Compiling in batches to avoid that unknown bug.
'/normal', const toBuildBatches = [
'/blog/post-1', ['/', '/another', '/something', '/normal'],
'/blog/post-1/comment-1', ['/blog/post-1', '/blog/post-1/comment-1', '/catchall/first'],
'/catchall/first',
] ]
await waitFor(2500) 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))) await Promise.all(toBuild.map((pg) => renderViaHTTP(next.url, pg)))
}
const browser = await webdriver(next.url, '/') const browser = await webdriver(next.url, '/')
let text = await browser.elementByCss('p').text() 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