From: Amaury Denoyelle Date: Thu, 15 Oct 2026 12:47:34 +0000 (+0200) Subject: REGTESTS: use HAPROXY_TEST_TIMEOUT for wait in purge srv/be X-Git-Tag: v3.5-dev10~192 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=aedad8b8616a3092143e19ad4728a81fcadbc0c4;p=haproxy.git REGTESTS: use HAPROXY_TEST_TIMEOUT for wait in purge srv/be 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. --- diff --git a/reg-tests/proxy/cli_purge_backend.vtc b/reg-tests/proxy/cli_purge_backend.vtc index e83adc912..b07ecaa28 100644 --- a/reg-tests/proxy/cli_purge_backend.vtc +++ b/reg-tests/proxy/cli_purge_backend.vtc @@ -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; } } diff --git a/reg-tests/server/cli_purge_all_servers.vtc b/reg-tests/server/cli_purge_all_servers.vtc index bbe73a3d5..8596073be 100644 --- a/reg-tests/server/cli_purge_all_servers.vtc +++ b/reg-tests/server/cli_purge_all_servers.vtc @@ -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; } } diff --git a/reg-tests/server/cli_purge_server.vtc b/reg-tests/server/cli_purge_server.vtc index c722facb3..5d8c184d9 100644 --- a/reg-tests/server/cli_purge_server.vtc +++ b/reg-tests/server/cli_purge_server.vtc @@ -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; } }