@@ -83,10 +83,8 @@ async function testLargeExecStdout(devboxId: string) {
8383
8484 if ( result . status !== 'completed' ) throw new Error ( `status=${ result . status } ` ) ;
8585 const stdout = result . stdout ?? '' ;
86- if ( stdout . length < 900_000 )
87- throw new Error ( `stdout too short: ${ stdout . length } bytes (expected ~1 MB)` ) ;
88- if ( / \s / . test ( stdout . trim ( ) ) )
89- throw new Error ( 'stdout contains unexpected whitespace (base64 wrap bug?)' ) ;
86+ if ( stdout . length < 900_000 ) throw new Error ( `stdout too short: ${ stdout . length } bytes (expected ~1 MB)` ) ;
87+ if ( / \s / . test ( stdout . trim ( ) ) ) throw new Error ( 'stdout contains unexpected whitespace (base64 wrap bug?)' ) ;
9088
9189 pass ( name , `${ ( stdout . length / 1024 ) . toFixed ( 0 ) } KB received` ) ;
9290 } catch ( err ) {
@@ -144,8 +142,7 @@ async function testExecLargeStderr(devboxId: string) {
144142
145143 if ( result . status !== 'completed' ) throw new Error ( `status=${ result . status } ` ) ;
146144 const stderr = result . stderr ?? '' ;
147- if ( stderr . length < 900_000 )
148- throw new Error ( `stderr too short: ${ stderr . length } bytes (expected ~1 MB)` ) ;
145+ if ( stderr . length < 900_000 ) throw new Error ( `stderr too short: ${ stderr . length } bytes (expected ~1 MB)` ) ;
149146
150147 pass ( name , `${ ( stderr . length / 1024 ) . toFixed ( 0 ) } KB received on stderr` ) ;
151148 } catch ( err ) {
@@ -202,11 +199,8 @@ async function testLargeReadFileContents(devboxId: string) {
202199 } ) ;
203200
204201 if ( content . length !== expectedSize )
205- throw new Error (
206- `length mismatch: server=${ expectedSize } , received=${ content . length } ` ,
207- ) ;
208- if ( md5 ( content ) !== remoteHash )
209- throw new Error ( `md5 mismatch: remote=${ remoteHash } — DATA CORRUPTED` ) ;
202+ throw new Error ( `length mismatch: server=${ expectedSize } , received=${ content . length } ` ) ;
203+ if ( md5 ( content ) !== remoteHash ) throw new Error ( `md5 mismatch: remote=${ remoteHash } — DATA CORRUPTED` ) ;
210204
211205 pass ( name , `${ ( content . length / 1024 / 1024 ) . toFixed ( 1 ) } MB received, md5 verified` ) ;
212206 } catch ( err ) {
@@ -308,13 +302,10 @@ async function testConcurrentLargeDownloads(devboxId: string) {
308302 const fileName = `loadtest-concurrent-${ i } .dat` ;
309303 const expectedHash = remoteHashes [ fileName ] ;
310304 if ( ! expectedHash ) throw new Error ( `no hash for ${ fileName } ` ) ;
311- if ( buf . length !== 5 * 1024 * 1024 )
312- throw new Error ( `file ${ i } : size mismatch (got ${ buf . length } )` ) ;
305+ if ( buf . length !== 5 * 1024 * 1024 ) throw new Error ( `file ${ i } : size mismatch (got ${ buf . length } )` ) ;
313306 const localHash = md5 ( buf ) ;
314307 if ( localHash !== expectedHash )
315- throw new Error (
316- `file ${ i } : md5 mismatch remote=${ expectedHash } local=${ localHash } — DATA CORRUPTED` ,
317- ) ;
308+ throw new Error ( `file ${ i } : md5 mismatch remote=${ expectedHash } local=${ localHash } — DATA CORRUPTED` ) ;
318309 }
319310
320311 pass ( name , `5 × 5 MB downloaded and verified` ) ;
@@ -341,11 +332,9 @@ async function testSseStreamingLargeOutput(devboxId: string) {
341332 }
342333
343334 const lines = received . trim ( ) . split ( '\n' ) ;
344- if ( lines . length !== 10000 )
345- throw new Error ( `expected 10000 lines via SSE, got ${ lines . length } ` ) ;
335+ if ( lines . length !== 10000 ) throw new Error ( `expected 10000 lines via SSE, got ${ lines . length } ` ) ;
346336 if ( lines [ 0 ] !== '1' ) throw new Error ( `first SSE line wrong: ${ JSON . stringify ( lines [ 0 ] ) } ` ) ;
347- if ( lines [ 9999 ] !== '10000' )
348- throw new Error ( `last SSE line wrong: ${ JSON . stringify ( lines [ 9999 ] ) } ` ) ;
337+ if ( lines [ 9999 ] !== '10000' ) throw new Error ( `last SSE line wrong: ${ JSON . stringify ( lines [ 9999 ] ) } ` ) ;
349338
350339 pass ( name , `${ lines . length } lines streamed via SSE` ) ;
351340 } catch ( err ) {
@@ -371,11 +360,7 @@ async function testSseEarlyCancel(devboxId: string) {
371360 longPoll : { timeoutMs : 30_000 } ,
372361 } ) ;
373362
374- const stream = await client . devboxes . executions . streamStdoutUpdates (
375- devboxId ,
376- started . execution_id ,
377- { } ,
378- ) ;
363+ const stream = await client . devboxes . executions . streamStdoutUpdates ( devboxId , started . execution_id , { } ) ;
379364
380365 // Break after the very first event — cancels the ReadableStream immediately
381366 // while the h2 session still has a large backlog of DATA frames buffered.
0 commit comments