]> git.kaiwu.me - haproxy.git/commitdiff
REGTESTS: use HAPROXY_TEST_TIMEOUT for wait in purge srv/be
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 15 Oct 2026 12:47:34 +0000 (14:47 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 15 Oct 2026 13:00:15 +0000 (15:00 +0200)
Replace hardcoded value for wait timeout in regtests for server/backend
purge mechanism. The variable HAPROXY_TEST_TIMEOUT is used with 5s as a
default value if unspecified, similar to what is already used for
haproxy timeout in most of the test suite.

This should prevent spurrious test failures due to timing issue. In
particular, this should fix github CI runners execution.

Some timers remain hardcoded to small values when wait is expected to
either fail or suceed immediately. A larger value would cause the test
to take an unnecessary delay when a real failure should be reported.

reg-tests/proxy/cli_purge_backend.vtc
reg-tests/server/cli_purge_all_servers.vtc
reg-tests/server/cli_purge_server.vtc

index e83adc912c31d83c70dee9c8b94db38c41c69957..b07ecaa287eed124e13bdf7c4d7887cdb5bc0b44 100644 (file)
@@ -71,7 +71,7 @@ shell {
        [ "$out" = "Backend deleted." ] || \
          { echo "expect failure: backend not immediately deleted: ${out}"; exit 1; }
 
-       out=$(echo "wait 10ms be-unknown be1" | socat -,ignoreeof=1 "${tmpdir}/h1/stats")
+       out=$(echo "wait ${HAPROXY_TEST_TIMEOUT-5s} be-unknown be1" | socat -,ignoreeof=1 "${tmpdir}/h1/stats")
        [ "$out" = "Done." ] || \
          { echo "expect failure: wait be-unknown not validated: ${out}"; exit 1; }
 }
@@ -105,7 +105,7 @@ client c1 -wait
 
 shell {
        # Backend should now be removed and wait should success
-       out=$(echo "wait 1s be-unknown be2" | socat -,ignoreeof=1 "${tmpdir}/h1/stats")
+       out=$(echo "wait ${HAPROXY_TEST_TIMEOUT-5s} be-unknown be2" | socat -,ignoreeof=1 "${tmpdir}/h1/stats")
        [ "$out" = "Done." ] || \
          { echo "expect failure: wait be-unknown not successful: ${out}"; exit 1; }
 }
index bbe73a3d5680927a5528e6a0f3c9bd14559118d5..8596073be475dd327d2c62db9386d6558ba4b67c 100644 (file)
@@ -73,7 +73,7 @@ barrier b1 sync
 
 shell {
        # Check that the server is deleted
-       out=$(echo "wait 1s srv-unknown be2/srv1" | socat -,ignoreeof=1 "${tmpdir}/h1/stats")
+       out=$(echo "wait ${HAPROXY_TEST_TIMEOUT-5s} srv-unknown be2/srv1" | socat -,ignoreeof=1 "${tmpdir}/h1/stats")
        [ "$out" = "Done." ] || \
          { echo "expect failure: wait srv-unknown failure: ${out}"; exit 1; }
 }
index c722facb35955b5c6be3b831e73f3c360feda83e..5d8c184d9ceac25dba6b59d1eae1a6a647c9c777 100644 (file)
@@ -79,7 +79,7 @@ barrier b1 sync
 
 shell {
        # Check that the server is deleted
-       out=$(echo "wait 1s srv-unknown be/srv2" | socat -,ignoreeof=1 "${tmpdir}/h1/stats")
+       out=$(echo "wait ${HAPROXY_TEST_TIMEOUT-5s} srv-unknown be/srv2" | socat -,ignoreeof=1 "${tmpdir}/h1/stats")
        [ "$out" = "Done." ] || \
          { echo "expect failure: wait srv-unknown failure: ${out}"; exit 1; }
 }