From 957513ffb6889891a28680e67408589869ae84bc Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sat, 24 Oct 2026 14:11:01 -0500 Subject: [PATCH] test(mesh): keep T2's refused body inside the socket buffer (#120) T2 sent a 1,000,001-byte body against the 1 MB default. The teacup answers 413 with `connection: close` while the client is still uploading, so the client sometimes saw EPIPE instead of the 413: about 1 run in 10, on develop too. That is the transport racing the answer, not a different answer. Run it against a 1,000-byte limit, the way the edge suite already does. CARD-24's T2 asks only for "body > maxBodyBytes". 0 failures in 30 runs, against 2 in 20 before. Signed-off-by: Diego Resendez --- test/mesh/large-body.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/mesh/large-body.test.ts b/test/mesh/large-body.test.ts index 838989f..02bad0e 100644 --- a/test/mesh/large-body.test.ts +++ b/test/mesh/large-body.test.ts @@ -105,9 +105,12 @@ describe('mesh RPC body near maxBodyBytes (#120)', () => { }); it('a body over maxBodyBytes is refused 413 by the teacup, and the channel stays open (T2)', async () => { - const { post, close } = await pair(); + // A small limit, so the refused body fits in the socket buffer. Over the 1 MB default, the 413 + // and its `connection: close` land mid-upload and the client can see EPIPE instead: the + // transport racing the answer, not a different answer (the edge suite does the same). + const { post, close } = await pair(1_000); try { - expect((await post(json(1_000_001))).status).toBe(413); + expect((await post(json(1_001))).status).toBe(413); expect((await post(json(1_000))).status).toBe(200); } finally { await close();