Skip to content

Commit 439af6e

Browse files
authored
test(cache-handler): increase timeout before refetching (#244)
1 parent c20e642 commit 439af6e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/integration/cache-handler.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('page router', () => {
8989
)
9090

9191
// wait to have page regenerated in the background
92-
await new Promise<void>((resolve) => setTimeout(resolve, 500))
92+
await new Promise<void>((resolve) => setTimeout(resolve, 1000))
9393

9494
const call2 = await invokeFunction(ctx, { url: 'static/revalidate-automatic' })
9595
const call2Date = load(call2.body)('[data-testid="date-now"]').text()
@@ -145,7 +145,7 @@ describe('page router', () => {
145145
)
146146

147147
// it does not wait for the cache.set so we have to manually wait here until the blob storage got populated
148-
await new Promise<void>((resolve) => setTimeout(resolve, 500))
148+
await new Promise<void>((resolve) => setTimeout(resolve, 1000))
149149

150150
// now the page should be in cache again and we should get a cache hit
151151
const call4 = await invokeFunction(ctx, { url: 'static/revalidate-automatic' })
@@ -227,7 +227,7 @@ describe('app router', () => {
227227
expect(staleDate, 'the date was cached and is matching the initial one').not.toBe(post1Date)
228228

229229
// it does not wait for the cache.set so we have to manually wait here until the blob storage got populated
230-
await new Promise<void>((resolve) => setTimeout(resolve, 500))
230+
await new Promise<void>((resolve) => setTimeout(resolve, 1000))
231231

232232
// now the page should be in cache again and we should get a cache hit
233233
const cached = await invokeFunction(ctx, { url: 'posts/1' })
@@ -299,7 +299,7 @@ describe('route', () => {
299299
)
300300

301301
// it does not wait for the cache.set so we have to manually wait here until the blob storage got populated
302-
await new Promise<void>((resolve) => setTimeout(resolve, 500))
302+
await new Promise<void>((resolve) => setTimeout(resolve, 1000))
303303

304304
const call2 = await invokeFunction(ctx, { url: '/api/revalidate-handler' })
305305
const call2Body = JSON.parse(call2.body)
@@ -337,7 +337,7 @@ describe('route', () => {
337337
).toBe(call3Time)
338338

339339
// it does not wait for the cache.set so we have to manually wait here until the blob storage got populated
340-
await new Promise<void>((resolve) => setTimeout(resolve, 500))
340+
await new Promise<void>((resolve) => setTimeout(resolve, 1000))
341341

342342
const call4 = await invokeFunction(ctx, { url: '/api/revalidate-handler' })
343343
expect(call4.statusCode).toBe(200)

0 commit comments

Comments
 (0)