Skip to content

Commit 4332e52

Browse files
Reflexclaude
andcommitted
style(loadtest): fix prettier formatting errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 21f089e commit 4332e52

3 files changed

Lines changed: 13 additions & 36 deletions

File tree

loadtest/cancel-test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ async function main() {
4343
});
4444

4545
// Stream stdout but break immediately after the first event
46-
const stream = await client.devboxes.executions.streamStdoutUpdates(
47-
devbox.id,
48-
exec.execution_id,
49-
{},
50-
);
46+
const stream = await client.devboxes.executions.streamStdoutUpdates(devbox.id, exec.execution_id, {});
5147
let count = 0;
5248
for await (const _chunk of stream) {
5349
count++;

loadtest/h2-stress-test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,14 @@ async function main() {
103103
const remoteHash = remoteHashes[fname];
104104

105105
if (buf.length !== expectedSize) {
106-
console.error(
107-
` ✗ File ${n}: size mismatch — expected ${expectedSize}, got ${buf.length}`,
108-
);
106+
console.error(` ✗ File ${n}: size mismatch — expected ${expectedSize}, got ${buf.length}`);
109107
allOk = false;
110108
continue;
111109
}
112110

113111
const localHash = md5(buf);
114112
if (localHash !== remoteHash) {
115-
console.error(
116-
` ✗ File ${n}: md5 mismatch — remote=${remoteHash} local=${localHash} DATA CORRUPTED`,
117-
);
113+
console.error(` ✗ File ${n}: md5 mismatch — remote=${remoteHash} local=${localHash} DATA CORRUPTED`);
118114
allOk = false;
119115
} else {
120116
console.log(` ✓ File ${n}: ${FILE_SIZE_MB} MB, md5 OK`);

loadtest/large-response-test.ts

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)