From edbae06c3d3772ac642d998429bcba680bc2ab59 Mon Sep 17 00:00:00 2001 From: shoemoney Date: Tue, 23 Jun 2026 03:17:32 -0500 Subject: [PATCH] =?UTF-8?q?test:=20drop=20tautological=20byte-cap=20invari?= =?UTF-8?q?ant=20test=20(ponytail)=20=E2=99=BB=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per ponytail review of the hardening batch: TestHubByteCapsAreSane only fails on a deliberate const edit (not a real bug) and its comment described timeouts it never tested. The happy-path limits test carries the regression weight. --- internal/hub/limits_test.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/internal/hub/limits_test.go b/internal/hub/limits_test.go index 403d62a..306c1d4 100644 --- a/internal/hub/limits_test.go +++ b/internal/hub/limits_test.go @@ -31,17 +31,3 @@ func TestHubRequestsUnderLimitsSucceed(t *testing.T) { t.Fatalf("POST have under cap = %d, want 200; body=%s", status, body) } } - -// TestHubServerTimeoutsConfigured documents the intended hardening: the hub sets -// read/idle timeouts but deliberately leaves WriteTimeout unset so the long-lived -// /v1/events SSE stream is not killed mid-flight. The actual http.Server is built -// in cmd/devbox-hub; this test pins the constants so a careless edit that drops -// the caps trips here. -func TestHubByteCapsAreSane(t *testing.T) { - if maxJSONBytes <= 0 || maxBlobBytes <= 0 { - t.Fatalf("byte caps must be positive: json=%d blob=%d", maxJSONBytes, maxBlobBytes) - } - if maxJSONBytes >= maxBlobBytes { - t.Fatalf("maxJSONBytes (%d) should be much smaller than maxBlobBytes (%d)", maxJSONBytes, maxBlobBytes) - } -}