Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
920b2c00
Unverified
Commit
920b2c00
authored
Oct 30, 2025
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Oct 30, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] Remove `maxRetries` and `hardError` parameters (#85536)
parent
f0b97b7e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
33 deletions
+35
-33
app-action.test.ts
test/e2e/app-dir/actions/app-action.test.ts
+24
-7
index.test.ts
test/e2e/getserversideprops/test/index.test.ts
+3
-7
next-test-utils.ts
test/lib/next-test-utils.ts
+8
-19
No files found.
test/e2e/app-dir/actions/app-action.test.ts
View file @
920b2c00
...
@@ -2,7 +2,6 @@ import { FileRef, nextTestSetup } from 'e2e-utils'
...
@@ -2,7 +2,6 @@ import { FileRef, nextTestSetup } from 'e2e-utils'
import
{
import
{
assertHasRedbox
,
assertHasRedbox
,
retry
,
retry
,
check
,
waitFor
,
waitFor
,
getRedboxSource
,
getRedboxSource
,
getDistDir
,
getDistDir
,
...
@@ -527,8 +526,14 @@ describe('app-dir action handling', () => {
...
@@ -527,8 +526,14 @@ describe('app-dir action handling', () => {
// navigate to server
// navigate to server
await
browser
.
elementByCss
(
'#navigate-server'
).
click
()
await
browser
.
elementByCss
(
'#navigate-server'
).
click
()
// intentionally bailing after 2 retries so we don't retry to the point where the async function resolves
// intentionally bailing after 2s so we don't retry to the point where the async function resolves
await
check
(()
=>
browser
.
url
(),
`
${
next
.
url
}
/server`
,
true
,
2
)
await
retry
(
async
()
=>
{
expect
(
await
browser
.
url
()).
toEqual
(
`
${
next
.
url
}
/server`
)
},
2000
,
1000
)
browser
=
await
next
.
browser
(
'/server'
)
browser
=
await
next
.
browser
(
'/server'
)
...
@@ -536,8 +541,14 @@ describe('app-dir action handling', () => {
...
@@ -536,8 +541,14 @@ describe('app-dir action handling', () => {
// navigate to client
// navigate to client
await
browser
.
elementByCss
(
'#navigate-client'
).
click
()
await
browser
.
elementByCss
(
'#navigate-client'
).
click
()
// intentionally bailing after 2 retries so we don't retry to the point where the async function resolves
// intentionally bailing after 2s so we don't retry to the point where the async function resolves
await
check
(()
=>
browser
.
url
(),
`
${
next
.
url
}
/client`
,
true
,
2
)
await
retry
(
async
()
=>
{
expect
(
await
browser
.
url
()).
toEqual
(
`
${
next
.
url
}
/client`
)
},
2000
,
1000
)
})
})
it
(
'should not block router.back() while a server action is in flight'
,
async
()
=>
{
it
(
'should not block router.back() while a server action is in flight'
,
async
()
=>
{
...
@@ -549,8 +560,14 @@ describe('app-dir action handling', () => {
...
@@ -549,8 +560,14 @@ describe('app-dir action handling', () => {
await
browser
.
back
()
await
browser
.
back
()
// intentionally bailing after 2 retries so we don't retry to the point where the async function resolves
// intentionally bailing after 2s so we don't retry to the point where the async function resolves
await
check
(()
=>
browser
.
url
(),
`
${
next
.
url
}
/`
,
true
,
2
)
await
retry
(
async
()
=>
{
expect
(
await
browser
.
url
()).
toEqual
(
`
${
next
.
url
}
/`
)
},
2000
,
1000
)
})
})
it
(
'should trigger a refresh for a server action that also dispatches a navigation event'
,
async
()
=>
{
it
(
'should trigger a refresh for a server action that also dispatches a navigation event'
,
async
()
=>
{
...
...
test/e2e/getserversideprops/test/index.test.ts
View file @
920b2c00
...
@@ -598,13 +598,9 @@ const runTests = (isDev = false, isDeploy = false) => {
...
@@ -598,13 +598,9 @@ const runTests = (isDev = false, isDeploy = false) => {
it
(
'should load a fast refresh page'
,
async
()
=>
{
it
(
'should load a fast refresh page'
,
async
()
=>
{
const
browser
=
await
webdriver
(
next
.
url
,
'/refresh'
)
const
browser
=
await
webdriver
(
next
.
url
,
'/refresh'
)
expect
(
await
retry
(
async
()
=>
{
await
check
(
expect
(
await
browser
.
elementByCss
(
'p'
).
text
()).
toMatch
(
/client loaded/
)
()
=>
browser
.
elementByCss
(
'p'
).
text
(),
})
/client loaded/
,
false
)
).
toBe
(
true
)
})
})
it
(
'should provide correct query value for dynamic page'
,
async
()
=>
{
it
(
'should provide correct query value for dynamic page'
,
async
()
=>
{
...
...
test/lib/next-test-utils.ts
View file @
920b2c00
...
@@ -697,25 +697,18 @@ export async function startCleanStaticServer(dir: string) {
...
@@ -697,25 +697,18 @@ export async function startCleanStaticServer(dir: string) {
/**
/**
* Check for content in 1 second intervals timing out after 30 seconds.
* Check for content in 1 second intervals timing out after 30 seconds.
* @deprecated use retry + expect instead
* @deprecated use retry + expect instead
* @param {() => Promise<unknown> | unknown} contentFn
* @param {RegExp | string | number} regex
* @param {boolean} hardError
* @param {number} maxRetries
* @returns {Promise<boolean>}
*/
*/
export
async
function
check
(
export
async
function
check
(
contentFn
:
()
=>
any
|
Promise
<
any
>
,
contentFn
:
()
=>
unknown
|
Promise
<
unknown
>
,
regex
:
any
,
regex
:
any
hardError
=
true
,
):
Promise
<
boolean
>
{
maxRetries
=
30
let
content
:
unknown
)
{
let
lastErr
:
unknown
let
content
let
lastErr
for
(
let
tries
=
0
;
tries
<
maxRetries
;
tries
++
)
{
for
(
let
tries
=
0
;
tries
<
30
;
tries
++
)
{
try
{
try
{
content
=
await
contentFn
()
content
=
await
contentFn
()
if
(
typeof
regex
!==
typeof
/regex/
)
{
if
(
typeof
regex
!==
'object'
)
{
if
(
regex
===
content
)
{
if
(
regex
===
content
)
{
return
true
return
true
}
}
...
@@ -730,11 +723,7 @@ export async function check(
...
@@ -730,11 +723,7 @@ export async function check(
}
}
}
}
console
.
error
(
'TIMED OUT CHECK: '
,
{
regex
,
content
,
lastErr
})
console
.
error
(
'TIMED OUT CHECK: '
,
{
regex
,
content
,
lastErr
})
throw
new
Error
(
'TIMED OUT: '
+
regex
+
'
\
n
\
n'
+
content
+
'
\
n
\
n'
+
lastErr
)
if
(
hardError
)
{
throw
new
Error
(
'TIMED OUT: '
+
regex
+
'
\
n
\
n'
+
content
+
'
\
n
\
n'
+
lastErr
)
}
return
false
}
}
export
class
File
{
export
class
File
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment