Skip to content

Commit 55ec71a

Browse files
committed
test: give the two-part upload test real timeout headroom
The only test that pushes a real multi-part payload hashes 8 MiB twice and drives an actual R2 multipart upload, so it is CPU-bound. It takes ~11 s on a developer machine and ~33 s on a shared CI runner, which overran the 30 s timeout it had been given. Raise it to 120 s: still short enough to catch a genuine hang, wide enough that runner speed no longer decides the result. This is what has kept the private mirror's CI red since 2.5.0 landed.
1 parent 0aa6840 commit 55ec71a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

worker/test/instant-upload.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {
88
sha256Bytes,
99
} from '../src/lib/content-fingerprint'
1010

11+
const TWO_PART_UPLOAD_TIMEOUT_MS = 120_000
12+
1113
interface UploadInitData {
1214
instantUpload: boolean
1315
uploadToken?: string
@@ -208,6 +210,10 @@ describe('verified instant upload', () => {
208210
expect((await resolveAndDownload(second.code)).bytes).toEqual(content)
209211
})
210212

213+
// The only test that pushes a real multi-part payload: it hashes 8 MiB twice
214+
// (client manifest, then the Worker's streaming digest) and drives an actual R2
215+
// multipart upload. That is CPU-bound, so a shared CI runner takes roughly three
216+
// times as long as a developer machine and 30 s left no headroom.
211217
it('verifies and instantly reuses a real two-part upload', async () => {
212218
const content = new Uint8Array(CONTENT_FINGERPRINT_PART_SIZE + 1)
213219
content[0] = 0x52
@@ -243,7 +249,7 @@ describe('verified instant upload', () => {
243249
const downloaded = await resolveAndDownload(instant.code)
244250
expect(downloaded.data.file_name).toBe('two-part-copy.bin')
245251
expect(downloaded.bytes).toEqual(content)
246-
}, 30_000)
252+
}, TWO_PART_UPLOAD_TIMEOUT_MS)
247253

248254
it('does not expose a hash-only lookup without the prior capability', async () => {
249255
const content = new TextEncoder().encode('capability protected bytes')

0 commit comments

Comments
 (0)