From: Christopher Faulet Date: Thu, 1 Sep 2022 17:46:28 +0000 (+0200) Subject: REGTESTS: http_request_buffer: Add a barrier to not mix up log messages X-Git-Tag: v2.7-dev5~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05ed05b84a4898122568df48bebfd59746ebe2a2;p=thirdparty%2Fhaproxy.git REGTESTS: http_request_buffer: Add a barrier to not mix up log messages 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. --- diff --git a/reg-tests/http-messaging/http_request_buffer.vtc b/reg-tests/http-messaging/http_request_buffer.vtc index a45d155033..e9a90c58f1 100644 --- a/reg-tests/http-messaging/http_request_buffer.vtc +++ b/reg-tests/http-messaging/http_request_buffer.vtc @@ -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/ .* 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/ [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.