]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: Fix prometheus script to perform HTTP health-checks
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 Aug 2022 10:17:31 +0000 (12:17 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 Aug 2022 10:17:34 +0000 (12:17 +0200)
TCP Health-checks are enabled on server "s2". However it expects to receive
an HTTP requests. So HAProxy configuration must be changed to perform HTTP
health-checks instead. Otherwise, depending on the timing, an error can be
triggered if a check is performed before the end of the script.

This scripts never failed because TCP_QUICKACK was disabled, adding some
latency on health-checks. But since the last fix, it is an issue.

This patch should be backported as far as 2.4.

reg-tests/contrib/prometheus.vtc

index 1ac61335686aa5ac9839700068ee9cf84935c54b..a481240248b85a26dc8fd617d91c0b0f17efa9d3 100644 (file)
@@ -8,12 +8,12 @@ feature ignore_unknown_macro
 server s1 {
        rxreq
        txresp
-} -repeat 2 -start
+} -start
 
 server s2 {
        rxreq
        txresp
-} -repeat 2 -start
+}  -start
 
 haproxy h1 -conf {
     defaults
@@ -33,8 +33,9 @@ haproxy h1 -conf {
 
     backend be
        stick-table type ip size 1m expire 10s store http_req_rate(10s)
+       option httpchk
        server s1 ${s1_addr}:${s1_port}
-       server s2 ${s2_addr}:${s2_port} check maxqueue 10 maxconn 12 pool-max-conn 42
+       server s2 ${s2_addr}:${s2_port} check inter 5s maxqueue 10 maxconn 12 pool-max-conn 42
 } -start
 
 client c1 -connect ${h1_stats_sock} {