From c2d6b5a472b8e6fa556f14a2ee46848fd5c9ab9f Mon Sep 17 00:00:00 2001 From: eps1lon Date: Mon, 15 Jul 2024 18:02:34 +0200 Subject: [PATCH] Ensure the flakiness highlighted in the new test does not leak to other tests --- test/development/app-hmr/hmr.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/development/app-hmr/hmr.test.ts b/test/development/app-hmr/hmr.test.ts index e3d8c69b81999..c89a4e3eb47a3 100644 --- a/test/development/app-hmr/hmr.test.ts +++ b/test/development/app-hmr/hmr.test.ts @@ -131,6 +131,11 @@ describe(`app-dir-hmr`, () => { }) it('should update server components pages when env files is changed (nodejs)', async () => { + // If "should update server components after navigating to a page with a different runtime" failed, the dev server is in a corrupted state. + // Restart fixes this. + await next.stop() + await next.start() + const envContent = await next.readFile(envFile) const browser = await next.browser('/env/node') expect(await browser.elementByCss('p').text()).toBe('mac') @@ -167,6 +172,10 @@ describe(`app-dir-hmr`, () => { }) it('should update server components pages when env files is changed (edge)', async () => { + // Restart to work around a bug highlighted in the flakiness of "should update server components after navigating to a page with a different runtime" + await next.stop() + await next.start() + const envContent = await next.readFile(envFile) const browser = await next.browser('/env/edge') expect(await browser.elementByCss('p').text()).toBe('mac')