From 803a9e9dd8646164ad87c8f97ab465d7bbeaa3ec Mon Sep 17 00:00:00 2001 From: clawbot <35+clawbot@noreply.example.org> Date: Wed, 11 Nov 2026 06:30:55 +0100 Subject: [PATCH] rproxy tests: give the over-1 MiB answers a 60 s time limit (closes #323) Test only. The over-1 MiB cases of `TestAnAnswerThatCannotBePassedOnIsAnswered502`, and `TestAnAnswerThatCannotBePassedOnGetsNoReport`, which sends the same answer, left `SWRP_TIMEOUT_MS` at 2 s. On a loaded host `rproxy` applied `SWRP_DEFAULT_DISPOSITION` before it had read the whole answer, and the tests, which want `502`, failed. They now set `SWRP_TIMEOUT_MS` to `60000`, as the file's other tests do where that limit is not what they test. Model: opus-5-5 --- internal/rproxy/rproxy_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/rproxy/rproxy_test.go b/internal/rproxy/rproxy_test.go index 0e6e2e8..3f0a7a9 100644 --- a/internal/rproxy/rproxy_test.go +++ b/internal/rproxy/rproxy_test.go @@ -1117,6 +1117,7 @@ func TestAnAnswerThatCannotBePassedOnIsAnswered502(t *testing.T) { t.Error("the app was asked") }) addr, out := startRProxy(t, backend(t), app.URL, map[string]string{ + timeoutSetting: "60000", defaultDisposition: setting, }) @@ -1140,7 +1141,9 @@ func TestAnAnswerThatCannotBePassedOnGetsNoReport(t *testing.T) { t.Parallel() standIn := startWAF(t, overOneMiB(dispositionDeny)) - addr, out := startRProxy(t, standIn.URL, nowhere, nil) + addr, out := startRProxy(t, standIn.URL, nowhere, map[string]string{ + timeoutSetting: "60000", + }) if got := get(t, addr, "/"); got.status != http.StatusBadGateway { t.Errorf("answered %+v, want 502", got)