]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: http_request_buffer: Add a barrier to not mix up log messages
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 1 Sep 2022 17:46:28 +0000 (19:46 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 1 Sep 2022 17:46:28 +0000 (19:46 +0200)
Depending on the timing, time to time, the log messages can be mixed. A
client can start and be fully handled by HAProxy (including its log message)
before the log message of the previous client was emitted or received.  To
fix the issue, a barrier was added to be sure to eval the "expect" rule on
logs before starting the next client.

This patch should fix the issue #1847. It may be backported to all branches
containing this reg-tests.

reg-tests/http-messaging/http_request_buffer.vtc

index a45d1550337b8884801e8816c626a4cda56ace35..e9a90c58f158b0eeea0927007c36ab38994b5430 100644 (file)
@@ -8,6 +8,8 @@ feature ignore_unknown_macro
 # thanks to "http-buffer-request". If this was the case, c2 client
 # could not connect to s1 server and this would lead to make this test fail.
 
+barrier b1 cond 2 -cyclic
+
 server s1 {
        rxreq
        expect req.bodylen == 257
@@ -23,10 +25,16 @@ server s1 {
 syslog S -level info {
        recv
        expect ~ "[^:\\[ ]*\\[[0-9]*\\]: .* .* fe1 fe1/<NOSRV> .* 408 .* - - cD-- .* .* \"GET /this-is-a-long-url-this-is-a-long-url-this-is-a-long-url-this-is-a-long-url-this-is-a-long-url-this-is-a-long-url-this-is-a-long-url HTTP/1\\.1\""
+       barrier b1 sync
+
        recv
        expect ~ "[^:\\[ ]*\\[[0-9]*\\]: .* .* fe1 be1/srv1 [0-9]*/[0-9]*/[0-9]*/[0-9]*/[0-9]* 200 .* - - ---- .* .* \"GET / HTTP/1\\.1\""
+       barrier b1 sync
+
        recv
        expect ~ "[^:\\[ ]*\\[[0-9]*\\]: .* .* fe2 be1/srv1 [0-9]*/[0-9]*/[0-9]*/[0-9]*/[0-9]* 200 .* - - ---- .* .* \"POST /1 HTTP/1\\.1\""
+       barrier b1 sync
+
        recv
        expect ~ "[^:\\[ ]*\\[[0-9]*\\]: .* .* fe2 be1/<NOSRV> [0-9]*/-1/-1/-1/[0-9]* -1 .* - - CR-- .* .* \"POST /2 HTTP/1\\.1\""
 } -start
@@ -86,6 +94,9 @@ client c1 -connect ${h1_fe1_sock} {
        expect resp.status == 408
 } -run
 
+# Wait matching on log message
+barrier b1 sync
+
 # Payload is fully sent
 #   ==> Request must be sent to the server. A 200 must be received
 client c2 -connect ${h1_fe1_sock} {
@@ -94,6 +105,9 @@ client c2 -connect ${h1_fe1_sock} {
        expect resp.status == 200
 } -run
 
+# Wait matching on log message
+barrier b1 sync
+
 # Payload is fully sent in 2 steps (with a small delay, smaller than the client
 # timeout) and split on a chunk size.
 #   ==> Request must be sent to the server. A 200 must be received
@@ -105,6 +119,9 @@ client c3 -connect ${h1_fe2_sock} {
        expect resp.status == 200
 } -run
 
+# Wait matching on log message
+barrier b1 sync
+
 # Last CRLF of the request payload is missing but payload is sent in 2 steps
 # (with a small delay, smaller than the client timeout) and split on a chunk
 # size. The client aborts before sending the last CRLF.