]> git.kaiwu.me - haproxy.git/commitdiff
REGTESTS: http-messaging: give each frontend its own syslog server
authorWilly Tarreau <w@1wt.eu>
Tue, 22 Sep 2026 22:16:40 +0000 (22:16 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 15:25:37 +0000 (17:25 +0200)
The two frontends of this test were logging to the same syslog server
and their two messages were expected in order. A stream is logged when
it ends, which may be after the next client has been served by the
other frontend, so that order is not guaranteed. This is the same race
which was caught in the raw hello test when the suite runs in parallel,
found here by inspection rather than by a failure.

reg-tests/http-messaging/http_no_delay.vtc

index 2044c0fa52e6e7f965fde23707286994aa52a5df..89257ad200dd98b5b604fe847978445f726762ad 100644 (file)
@@ -41,10 +41,16 @@ server s2 {
        chunkedlen 0
 } -start
 
+# One syslog server per frontend: a stream is logged when it ends, which
+# may be after the next client has been served by the other frontend, so
+# the two messages are only ordered within their own server.
 syslog Slg -level info {
        # three digits: the incomplete message waited for the cork timeout
        recv
        expect ~ ": delayed tt=[0-9]{3,} "
+} -start
+
+syslog Slg2 -level info {
        # one or two digits: it was pushed out immediately
        recv
        expect ~ ": nodelay tt=[0-9]{1,2} "
@@ -57,22 +63,24 @@ haproxy h1 -conf {
     .endif
         chroot /
        log "${Slg_addr}:${Slg_port}" local0 info
+       log "${Slg2_addr}:${Slg2_port}" local0 info
 
     defaults
        mode http
-       log global
        timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
        timeout client  "${HAPROXY_TEST_TIMEOUT-5s}"
        timeout server  "${HAPROXY_TEST_TIMEOUT-5s}"
 
     listen fe1
        bind "fd@${fe1}"
+       log "${Slg_addr}:${Slg_port}" local0 info
        log-format "delayed tt=%Tt td=%Td"
        server s1 ${s1_addr}:${s1_port}
 
     listen fe2
        bind "fd@${fe2}"
        option http-no-delay
+       log "${Slg2_addr}:${Slg2_port}" local0 info
        log-format "nodelay tt=%Tt td=%Td"
        server s2 ${s2_addr}:${s2_port}
 } -start
@@ -98,3 +106,4 @@ client c2 -connect ${h1_fe2_sock} {
 } -run
 
 syslog Slg -wait
+syslog Slg2 -wait