From 445477f333b0c12307e7a857fa56edc8672be395 Mon Sep 17 00:00:00 2001 From: sneak Date: Thu, 19 Nov 2026 09:12:35 +0000 Subject: [PATCH] sww: give startRProxyProcess's rproxy a minute for waf's answers startRProxyProcess still ran rproxy at the 2-second default of SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS. On a busy host, TestRProxyAsksAWAFThatSpeaksHTTP2OverHTTP1 could then get the app's 200 instead of waf's 403, as startRProxy's tests could before. Model: opus-5-5 --- internal/sww/rproxy_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/sww/rproxy_test.go b/internal/sww/rproxy_test.go index 49b8de1..c0cbc5f 100644 --- a/internal/sww/rproxy_test.go +++ b/internal/sww/rproxy_test.go @@ -552,7 +552,9 @@ func TestAStatusWAFDoesNotTakeIsReportedAs599(t *testing.T) { // startRProxyProcess runs `sww rproxy` in a process of its own, with the // settings in env, each as NAME=value. It returns where rproxy listens and a // function that sends rproxy SIGTERM and fails the test unless it exits with -// status 0 within waitLimit. +// status 0 within waitLimit. It waits a minute for waf's answers unless env +// sets SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS, so that a busy host cannot make it +// drop a question. func startRProxyProcess(t *testing.T, env ...string) (string, func()) { t.Helper() @@ -568,7 +570,8 @@ func startRProxyProcess(t *testing.T, env ...string) (string, func()) { cmd.Env = append(os.Environ(), commandForMain+"=rproxy", - "SWW_RPROXY_LISTEN_ADDR="+localhost+":0") + "SWW_RPROXY_LISTEN_ADDR="+localhost+":0", + wafBackendTimeout+"=60000") cmd.Env = append(cmd.Env, env...) exited := startProcess(t, cmd)