From 4af0509f5f6b2ff16a93c712362b5cc57f4e3a15 Mon Sep 17 00:00:00 2001 From: Manuel Schiller Date: Thu, 30 Apr 2026 21:45:32 +0200 Subject: [PATCH 1/2] stabilize test --- e2e/react-start/hmr/tests/app.spec.ts | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/e2e/react-start/hmr/tests/app.spec.ts b/e2e/react-start/hmr/tests/app.spec.ts index bbaff95bc13..5af93dc0dc7 100644 --- a/e2e/react-start/hmr/tests/app.spec.ts +++ b/e2e/react-start/hmr/tests/app.spec.ts @@ -269,10 +269,7 @@ async function captureOriginals() { const capturePromise = captureOriginals() -async function restoreRouteFiles( - forceRouteFileKeys: Iterable = [], -) { - const forceRestoreKeys = new Set(forceRouteFileKeys) +async function restoreRouteFiles() { const restoredRouteKeys: Array = [] for (const [key, filePath] of Object.entries(routeFiles) as Array< @@ -281,9 +278,7 @@ async function restoreRouteFiles( const content = originalContents[key] if (content === undefined) continue const current = await readFile(filePath, 'utf8') - // Re-emit pending restores in case the watcher coalesced the previous - // restore write and the dev server is still serving stale route options. - if (current !== content || forceRestoreKeys.has(key)) { + if (current !== content) { await writeFile(filePath, content) restoredRouteKeys.push(key) } @@ -552,15 +547,13 @@ test.describe('react-start hmr', () => { test.beforeEach(async ({ page }) => { await capturePromise - const pendingRouteKeys = Array.from(routeKeysPendingRestoreCheck) - const restoredRouteKeys = await restoreRouteFiles(pendingRouteKeys) + const routeKeysToCheck = new Set(routeKeysPendingRestoreCheck) + routeKeysPendingRestoreCheck.clear() + const restoredRouteKeys = await restoreRouteFiles() for (const routeFileKey of restoredRouteKeys) { - routeKeysPendingRestoreCheck.add(routeFileKey) + routeKeysToCheck.add(routeFileKey) } - const routeKeysToCheck = Array.from(routeKeysPendingRestoreCheck) - routeKeysPendingRestoreCheck.clear() - for (const routeFileKey of routeKeysToCheck) { await waitForRestoredRouteFile(page, routeFileKey) } @@ -736,7 +729,6 @@ test.describe('react-start hmr', () => { await waitForRouteModuleUpdate(page, '/child', 'Child Updated Again') }, ) - await waitForHydrationSafeReload(page, '/child', 'Child Updated Again') // Now navigate to /child — should see the LATEST value await page.getByTestId('child-link').click() @@ -755,6 +747,7 @@ test.describe('react-start hmr', () => { // Set up local state in the index route await page.getByTestId('increment').click() + await expect(page.getByTestId('count')).toHaveText('Count: 1') await page.getByTestId('increment').click() await page.getByTestId('message').fill('preserve me') @@ -885,7 +878,6 @@ test.describe('react-start hmr', () => { ), async () => {}, ) - await page.waitForTimeout(300) await reloadPageAndWaitForText( page, From 55af04edb1c6d3691b783c3423f743ffcccb6ba5 Mon Sep 17 00:00:00 2001 From: "nx-cloud[bot]" <71083854+nx-cloud[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 19:54:15 +0000 Subject: [PATCH 2/2] stabilize test [Self-Healing CI Rerun]