Skip to content

Commit

Permalink
Increase retry duration for HMR fetch logging tests
Browse files Browse the repository at this point in the history
As we've learned in #70467, compilation times can be quite high in CI,
when testing HMR behaviour. The fetch logging HMR tests are frequently
failing. Increasing the `retry` timeout should mitigate the flakiness.
  • Loading branch information
unstubbable committed Oct 12, 2024
1 parent 84ee9e6 commit af2342f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('server-components-hmr-cache', () => {
await retry(async () => {
const updatedContent = await browser.elementById('content').text()
expect(updatedContent).toBe('bar')
// TODO: remove custom duration in case we increase the default.
}, 5000)

const valueAfterPatch = await browser.elementById('value').text()
Expand All @@ -45,6 +46,7 @@ describe('server-components-hmr-cache', () => {
await retry(async () => {
const valueAfterRefresh = await browser.elementById('value').text()
expect(valueBeforeRefresh).not.toEqual(valueAfterRefresh)
// TODO: remove custom duration in case we increase the default.
}, 5000)
})

Expand All @@ -65,6 +67,7 @@ describe('server-components-hmr-cache', () => {
await retry(async () => {
const updatedContent = await browser.elementById('content').text()
expect(updatedContent).toBe('bar')
// TODO: remove custom duration in case we increase the default.
}, 5000)

const valueAfterPatch = getLoggedAfterValue()
Expand All @@ -83,6 +86,7 @@ describe('server-components-hmr-cache', () => {
await retry(async () => {
const valueAfterRefresh = getLoggedAfterValue()
expect(valueBeforeRefresh).not.toEqual(valueAfterRefresh)
// TODO: remove custom duration in case we increase the default.
}, 5000)
})
})
Expand Down Expand Up @@ -117,6 +121,7 @@ describe('server-components-hmr-cache', () => {
await retry(async () => {
const updatedContent = await browser.elementById('content').text()
expect(updatedContent).toBe('bar')
// TODO: remove custom duration in case we increase the default.
}, 5000)

const valueAfterPatch = await browser.elementById('value').text()
Expand Down Expand Up @@ -144,6 +149,7 @@ describe('server-components-hmr-cache', () => {
.elementById('content')
.text()
expect(updatedContent).toBe('bar')
// TODO: remove custom duration in case we increase the default.
}, 5000)

const valueAfterPatch = await retry(() => getLoggedAfterValue())
Expand Down
6 changes: 4 additions & 2 deletions test/e2e/app-dir/logging/fetch-logging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ describe('app-dir - logging', () => {
const logs = stripAnsi(next.cliOutput.slice(outputIndex))
expect(logs).toInclude(' GET /fetch-no-store')
expect(logs).not.toInclude(` │ GET `)
})
// TODO: remove custom duration in case we increase the default.
}, 5000)
)
})

Expand Down Expand Up @@ -285,7 +286,8 @@ describe('app-dir - logging', () => {
expect(logs).toInclude(
` │ GET ${expectedUrl}?request-input 200 in 1ms (HMR cache)`
)
})
// TODO: remove custom duration in case we increase the default.
}, 5000)
}
)
})
Expand Down
1 change: 1 addition & 0 deletions test/e2e/on-request-error/basic/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('on-request-error - basic', () => {
expect(recordLogLines).toEqual(
expect.arrayContaining([expect.stringContaining(errorMessage)])
)
// TODO: remove custom duration in case we increase the default.
}, 5000)

const json = await getOutputLogJson(next, outputLogPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('on-request-error - dynamic-routes', () => {
expect(recordLogLines).toEqual(
expect.arrayContaining([expect.stringContaining(errorMessage)])
)
// TODO: remove custom duration in case we increase the default.
}, 5000)

const json = await getOutputLogJson(next, outputLogPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('on-request-error - server-action-error', () => {
expect(recordLogLines).toEqual(
expect.arrayContaining([expect.stringContaining(errorMessage)])
)
// TODO: remove custom duration in case we increase the default.
}, 5000)

const json = await getOutputLogJson(next, outputLogPath)
Expand Down

0 comments on commit af2342f

Please sign in to comment.