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
10ce117b
Unverified
Commit
10ce117b
authored
Jul 16, 2025
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Jul 16, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] Fix `app-static` deploy test (#81712)
parent
9088ece1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
21 deletions
+45
-21
app-static.test.ts
test/e2e/app-dir/app-static/app-static.test.ts
+41
-17
page.tsx
...app-static/app/stale-cache-serving-edge/app-page/page.tsx
+1
-1
route.ts
...tatic/app/stale-cache-serving-edge/route-handler/route.ts
+1
-1
page.tsx
...-dir/app-static/app/stale-cache-serving/app-page/page.tsx
+1
-1
route.ts
...app-static/app/stale-cache-serving/route-handler/route.ts
+1
-1
No files found.
test/e2e/app-dir/app-static/app-static.test.ts
View file @
10ce117b
...
@@ -2763,27 +2763,51 @@ describe('app-dir static/dynamic handling', () => {
...
@@ -2763,27 +2763,51 @@ describe('app-dir static/dynamic handling', () => {
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
await
waitFor
(
1000
)
await
waitFor
(
1000
)
const
timings
=
{
start
:
Date
.
now
(),
startedStreaming
:
0
,
}
res
=
await
next
.
fetch
(
path
)
res
=
await
next
.
fetch
(
path
)
// eslint-disable-next-line no-loop-func
let
data
:
any
await
new
Promise
<
void
>
((
resolve
)
=>
{
let
startedStreaming
:
number
=
-
1
res
.
body
.
on
(
'data'
,
()
=>
{
res
.
body
.
on
(
'data'
,
()
=>
{
if
(
!
timings
.
startedStreaming
)
{
if
(
startedStreaming
===
-
1
)
{
timings
.
startedStreaming
=
Date
.
now
()
startedStreaming
=
Date
.
now
()
}
}
})
})
if
(
res
.
headers
.
get
(
'content-type'
).
includes
(
'application/json'
))
{
data
=
await
res
.
json
()
}
else
{
const
html
=
await
res
.
text
()
const
$
=
cheerio
.
load
(
html
)
const
dataJSON
=
$
(
'#data'
).
text
()
try
{
data
=
JSON
.
parse
(
dataJSON
)
}
catch
(
cause
)
{
throw
new
Error
(
`Failed to parse JSON from data-start attribute: "
${
dataJSON
}
"`
,
{
cause
}
)
}
}
res
.
body
.
on
(
'end'
,
()
=>
{
const
startedResponding
=
+
data
.
start
resolve
()
if
(
Number
.
isNaN
(
startedResponding
))
{
})
throw
new
Error
(
})
`Expected start to be a number. Received: "
${
data
.
start
}
"`
)
}
if
(
startedStreaming
===
-
1
)
{
throw
new
Error
(
'Expected startedStreaming to be set. This is a bug in the test.'
)
}
expect
(
timings
.
startedStreaming
-
timings
.
start
).
toBeLessThan
(
3000
)
// We just want to ensure the response isn't blocked on revalidating the fetch.
// So we use the start time when route started processing not when we
// send off the response because that includes cold boots of the infra.
if
(
startedStreaming
-
startedResponding
>=
3000
)
{
throw
new
Error
(
`Response #
${
i
}
took too long to complete:
${
startedStreaming
-
startedResponding
}
ms`
)
}
}
}
})
})
...
...
test/e2e/app-dir/app-static/app/stale-cache-serving-edge/app-page/page.tsx
View file @
10ce117b
...
@@ -13,7 +13,7 @@ export default async function Page(props) {
...
@@ -13,7 +13,7 @@ export default async function Page(props) {
return
(
return
(
<>
<>
<
p
id=
"data"
>
<
p
id=
"data"
>
{
JSON
.
stringify
({
fetchDuration
,
data
,
now
:
Date
.
now
()
})
}
{
JSON
.
stringify
({
fetchDuration
,
data
,
now
:
Date
.
now
()
,
start
})
}
</
p
>
</
p
>
</>
</>
)
)
...
...
test/e2e/app-dir/app-static/app/stale-cache-serving-edge/route-handler/route.ts
View file @
10ce117b
...
@@ -12,5 +12,5 @@ export async function GET(req: NextRequest) {
...
@@ -12,5 +12,5 @@ export async function GET(req: NextRequest) {
).
then
((
res
)
=>
res
.
json
())
).
then
((
res
)
=>
res
.
json
())
const
fetchDuration
=
Date
.
now
()
-
start
const
fetchDuration
=
Date
.
now
()
-
start
return
NextResponse
.
json
({
fetchDuration
,
data
,
now
:
Date
.
now
()
})
return
NextResponse
.
json
({
fetchDuration
,
data
,
now
:
Date
.
now
()
,
start
})
}
}
test/e2e/app-dir/app-static/app/stale-cache-serving/app-page/page.tsx
View file @
10ce117b
...
@@ -13,7 +13,7 @@ export default async function Page(props) {
...
@@ -13,7 +13,7 @@ export default async function Page(props) {
return
(
return
(
<>
<>
<
p
id=
"data"
>
<
p
id=
"data"
>
{
JSON
.
stringify
({
fetchDuration
,
data
,
now
:
Date
.
now
()
})
}
{
JSON
.
stringify
({
fetchDuration
,
data
,
now
:
Date
.
now
()
,
start
})
}
</
p
>
</
p
>
</>
</>
)
)
...
...
test/e2e/app-dir/app-static/app/stale-cache-serving/route-handler/route.ts
View file @
10ce117b
...
@@ -12,5 +12,5 @@ export async function GET(req: NextRequest) {
...
@@ -12,5 +12,5 @@ export async function GET(req: NextRequest) {
).
then
((
res
)
=>
res
.
json
())
).
then
((
res
)
=>
res
.
json
())
const
fetchDuration
=
Date
.
now
()
-
start
const
fetchDuration
=
Date
.
now
()
-
start
return
NextResponse
.
json
({
fetchDuration
,
data
,
now
:
Date
.
now
()
})
return
NextResponse
.
json
({
fetchDuration
,
data
,
now
:
Date
.
now
()
,
start
})
}
}
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