diff --git a/integration-tests/ssr/__tests__/ssr.js b/integration-tests/ssr/__tests__/ssr.js index 9fe736f202dae..5e9e33b77bbea 100644 --- a/integration-tests/ssr/__tests__/ssr.js +++ b/integration-tests/ssr/__tests__/ssr.js @@ -33,7 +33,7 @@ describe(`SSR`, () => { expect(String(childProcess.stdout)).toContain( `testing these paths for differences between dev & prod outputs` ) - }, 15000) + }, 30000) test(`it generates an error page correctly`, async () => { const src = path.join(__dirname, `/fixtures/bad-page.js`) diff --git a/integration-tests/ssr/test-output.js b/integration-tests/ssr/test-output.js index 0a952796f7c77..c3a205bebb92f 100644 --- a/integration-tests/ssr/test-output.js +++ b/integration-tests/ssr/test-output.js @@ -47,10 +47,10 @@ async function run() { // Fetch once to trigger re-compilation. await fetch(`${devSiteBasePath}/${path}`) - // Then wait for 6 seconds to ensure it's ready to go. + // Then wait for a second to ensure it's ready to go. // Otherwise, tests are flaky depending on the speed of the testing machine. await new Promise(resolve => { - setTimeout(() => resolve(), 6000) + setTimeout(() => resolve(), 1000) }) let devStatus = 200 @@ -103,7 +103,15 @@ async function run() { paths ) - const results = await Promise.all(paths.map(p => comparePath(p))) + const results = [] + + // Run comparisons serially, otherwise recompilation fetches + // interfere with each other when run within Promise.all + for (const path of paths) { + const result = await comparePath(path) + results.push(result) + } + // Test all true if (results.every(r => r)) { process.exit(0)