From: Willy Tarreau Date: Tue, 22 Sep 2026 22:53:53 +0000 (+0000) Subject: REGTESTS: http-rules: one connection per request in the replace-uri test X-Git-Tag: v3.5-dev8~5 X-Git-Url: https://git.kaiwu.me/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=2abc465986dedf3282b4ba3ca55432078ec86515;p=haproxy.git REGTESTS: http-rules: one connection per request in the replace-uri test The verification campaign caught this test with "HTTP header is incomplete" when the whole suite runs with "--j 32" on a loaded machine. Its first client was sending its six requests over a single connection while the server answers each of them in its own iteration, so the server closed right when the next request was sent over the connection haproxy reuses, and the client got that close instead of a response. The test is about rewriting the request target, not about keep-alive, so the six requests are now sent by six clients, each on its own connection, which is also what the three other clients of the test already do. Twenty-four runs in parallel with the machine loaded pass. --- diff --git a/reg-tests/http-rules/replace_uri.vtc b/reg-tests/http-rules/replace_uri.vtc index 6f0427026..58acdf319 100644 --- a/reg-tests/http-rules/replace_uri.vtc +++ b/reg-tests/http-rules/replace_uri.vtc @@ -65,36 +65,49 @@ haproxy h1 -conf { server s1 ${s1_addr}:${s1_port} } -start -client c1 -connect ${h1_fe_sock} { +# Each request gets its own connection: the server closes after every +# response, and a second request sent over the connection haproxy +# reuses would race with that close. +client c1a -connect ${h1_fe_sock} { # origin form, the whole target is prefixed txreq -url "/bar?t=prefix" rxresp expect resp.status == 200 expect resp.http.x-url == "/pfx/bar?t=prefix" +} -run +client c1b -connect ${h1_fe_sock} { # absolute form, the scheme and the authority are preserved txreq -url "http://www.example.com/bar?t=prefix" -hdr "Host: www.example.com" rxresp expect resp.status == 200 expect resp.http.x-url == "http://www.example.com/pfx/bar?t=prefix" +} -run +client c1c -connect ${h1_fe_sock} { # the scheme itself may be rewritten txreq -url "http://www.example.com/bar?t=scheme" -hdr "Host: www.example.com" rxresp expect resp.status == 200 expect resp.http.x-url == "https://www.example.com/bar?t=scheme" +} -run +client c1d -connect ${h1_fe_sock} { txreq -url "/bar?t=nomatch" rxresp expect resp.status == 200 expect resp.http.x-url == "/bar?t=nomatch" +} -run +client c1e -connect ${h1_fe_sock} { # replace-path ignores the query string, replace-pathq includes it txreq -url "/bar?t=path" rxresp expect resp.status == 200 expect resp.http.x-url == "/rp/bar?t=path" +} -run +client c1f -connect ${h1_fe_sock} { txreq -url "/bar?t=pathq" rxresp expect resp.status == 200