Skip to content

Commit af97c9c

Browse files
committed
Run React dev smoke tests sequentially.
1 parent f85f2d7 commit af97c9c

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎packages/react/test/integration/react-pages-client.test.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ afterAll(async () => {
207207
});
208208

209209
function defineClientTests(getBase: () => string, coverage: 'smoke' | 'full' = 'full') {
210-
describe.concurrent('shared client behavior', () => registerClientTests(getBase, coverage));
210+
// Cold dev clients each load the unbundled module graph. Keep that smoke
211+
// group serial; the full production contract still runs concurrently.
212+
const clientSuite = coverage === 'smoke' ? describe : describe.concurrent;
213+
clientSuite('shared client behavior', () => registerClientTests(getBase, coverage));
211214
describe.concurrent('deferred hydration', () => defineDeferredHydrationTests(getBase));
212215
}
213216

@@ -465,6 +468,7 @@ function defineTransitionAwaitTests(getBase: () => string, serverOutput: () => s
465468
}
466469

467470
function registerClientTests(getBase: () => string, coverage: 'smoke' | 'full') {
471+
const diagnostics = new WeakMap<Page, () => string>();
468472
registerSharedClientTests({ getBase, newPage, waitForHydration, coverage });
469473
if (coverage === 'smoke') {
470474
return;
@@ -479,11 +483,17 @@ function registerClientTests(getBase: () => string, coverage: 'smoke' | 'full')
479483
const context = await browser.newContext();
480484
const page = await context.newPage();
481485
page.setDefaultTimeout(10_000);
486+
diagnostics.set(page, collectBrowserDiagnostics(page));
482487
return page;
483488
}
484489

485490
async function waitForHydration(page: Page) {
486-
await page.waitForSelector('#app[data-hydrated="true"]');
491+
try {
492+
await page.waitForSelector('#app[data-hydrated="true"]');
493+
} catch (error) {
494+
console.error(diagnostics.get(page)?.());
495+
throw error;
496+
}
487497
}
488498

489499
it('hydrates without React errors', async () => {

0 commit comments

Comments
 (0)