Commit 0afe001c authored by Tobias Koppers's avatar Tobias Koppers

Reduce TLA chunks to 16 and use browser() for client-side test

512 chunks (~90s) timed out on CI machines. Back to 16 chunks which
comfortably fits within the 120s jest timeout on both local and CI.

Fix the client-tla-client test to use next.browser() instead of
next.fetch(), so the client-side TLA loop actually executes in the
browser rather than being skipped during SSR.
Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
parent 9d6cc93d
......@@ -4,7 +4,7 @@ const p = Promise.resolve()
if (typeof window !== 'undefined') {
console.log('promises start')
for (let chunk = 0; chunk < 2 ** 9; chunk++) {
for (let chunk = 0; chunk < 2 ** 4; chunk++) {
await new Promise<void>((resolve) => setTimeout(resolve, 0))
for (let i = 0; i < 2 ** 16; i++) {
await p
......
......@@ -4,7 +4,7 @@ const p = Promise.resolve()
if (typeof window === 'undefined') {
console.log('promises start')
for (let chunk = 0; chunk < 2 ** 9; chunk++) {
for (let chunk = 0; chunk < 2 ** 4; chunk++) {
await new Promise<void>((resolve) => setImmediate(resolve))
for (let i = 0; i < 2 ** 16; i++) {
await p
......
console.log('promises start')
const p = Promise.resolve()
for (let chunk = 0; chunk < 2 ** 9; chunk++) {
for (let chunk = 0; chunk < 2 ** 4; chunk++) {
await new Promise((resolve) => setImmediate(resolve))
for (let i = 0; i < 2 ** 16; i++) {
await p
......
......@@ -27,9 +27,8 @@ describe('many-promises', () => {
})
it('should handle many awaited promises in a Client Component with Top Level Await on the client', async () => {
const res = await next.fetch('/client-tla-client')
expect(res.status).toBe(200)
const html = await res.text()
expect(html).toContain('done')
const browser = await next.browser('/client-tla-client')
const text = await browser.elementByCss('p').text()
expect(text).toBe('done')
})
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment