Skip to content

Commit c2d6b5a

Browse files
committed
Ensure the flakiness highlighted in the new test does not leak to other tests
1 parent 7809d8f commit c2d6b5a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/development/app-hmr/hmr.test.ts

+9
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ describe(`app-dir-hmr`, () => {
131131
})
132132

133133
it('should update server components pages when env files is changed (nodejs)', async () => {
134+
// If "should update server components after navigating to a page with a different runtime" failed, the dev server is in a corrupted state.
135+
// Restart fixes this.
136+
await next.stop()
137+
await next.start()
138+
134139
const envContent = await next.readFile(envFile)
135140
const browser = await next.browser('/env/node')
136141
expect(await browser.elementByCss('p').text()).toBe('mac')
@@ -167,6 +172,10 @@ describe(`app-dir-hmr`, () => {
167172
})
168173

169174
it('should update server components pages when env files is changed (edge)', async () => {
175+
// Restart to work around a bug highlighted in the flakiness of "should update server components after navigating to a page with a different runtime"
176+
await next.stop()
177+
await next.start()
178+
170179
const envContent = await next.readFile(envFile)
171180
const browser = await next.browser('/env/edge')
172181
expect(await browser.elementByCss('p').text()).toBe('mac')

0 commit comments

Comments
 (0)