]> git.kaiwu.me - haproxy.git/commitdiff
REGTESTS: http-messaging: Fix abortonclose issue with connect_tunnels
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Nov 2026 07:04:04 +0000 (08:04 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Nov 2026 07:17:53 +0000 (08:17 +0100)
connect_tunnels.vtc script was fixed. The third test could be aborted before
the response was received if the connection to the server was not
synchronous. It appeared to be an issue, at least, on macOS. This happened
because C3 client was sending its tunneled data in a DATA frame carrying
END_STREAM, right after the CONNECT request. Depending on the timing, the
request could be aborted because "abortonclose" is now enabled by default.

To fix the issue, the END_STREAM flag is no longer set on the client DATA
frame. It is not mandatory for the test.

In addition, Barriers are now used instead of delay to make the frame
ordering deterministic.

reg-tests/http-messaging/connect_tunnels.vtc

index 2ee98a8a8d68dc9233eaff00308c003c8d31f3fa..3f67acf6330b78c22e46561b9f43f616ae79f881 100644 (file)
@@ -21,6 +21,7 @@ server s1 {
        expect req.method == "CONNECT"
        barrier b1 sync
        expect_close
+       barrier b1 sync
 } -start
 
 # H1 tunnel endpoint, data are exchanged in both directions
@@ -34,14 +35,16 @@ server s2 {
 } -start
 
 # Same, for the H2 frontend. The reply is delayed to be sure the window update
-# and the response headers are received first by the client.
+# for the tunneled data and the response headers are received in this order by
+# the client. Otherwise the window update may race with the response headers.
 server s3 {
        rxreq
        expect req.method == "CONNECT"
+       barrier b1 sync
        txresp -nolen
        recv 5
-       delay 0.3
        send "SRV->CLI"
+       barrier b1 sync
 } -start
 
 # H2 server refusing the CONNECT with a 403 carrying a payload and trailers.
@@ -116,7 +119,7 @@ client c1 -connect ${hap_fe_tlr_sock} {
                txreq -noadd -litHdr inc plain "x-trailer" plain "1"
        } -run
 
-       delay 1
+       barrier b1 sync
 } -run
 
 # H1 CONNECT, then tunneled data in both directions
@@ -146,15 +149,16 @@ client c3 -connect ${hap_fe_h2_sock} {
                  -litHdr inc plain ":method" plain "CONNECT" \
                  -litHdr inc plain ":authority" plain "${s3_addr}:${s3_port}" \
                  -nostrend
-               txdata -data "CLI>>"
+               txdata -data "CLI>>" -nostrend
                rxwinup
+               barrier b1 sync
                rxhdrs
                expect resp.status == 200
                rxdata
                expect resp.body == "SRV->CLI"
        } -run
 
-       delay 1
+       barrier b1 sync
 } -run
 
 # H2 CONNECT refused by the server with a payload and trailers. Both must be