REGTESTS: extend the default I/O timeouts and make them overridable
With the CI occasionally slowing down, we're starting to see again some
spurious failures despite the long 1-second timeouts. This reports false
positives that are disturbing and doesn't provide as much value as this
could. However at this delay it already becomes a pain for developers
to wait for the tests to complete.
This commit adds support for the new environment variable
HAPROXY_TEST_TIMEOUT that will allow anyone to modify the connect,
client and server timeouts. It was set to 5 seconds by default, which
should be plenty for quite some time in the CI. All relevant values
that were 200ms or above were replaced by this one. A few larger
values were left as they are special. One test for the set-timeout
action that used to rely on a fixed 1-sec value was extended to a
fixed 5-sec, as the timeout is normally not reached, but it needs
to be known to compare the old and new values.
diff --git a/reg-tests/http-rules/acl_cli_spaces.vtc b/reg-tests/http-rules/acl_cli_spaces.vtc
index 4db79a5..e61176a 100644
--- a/reg-tests/http-rules/acl_cli_spaces.vtc
+++ b/reg-tests/http-rules/acl_cli_spaces.vtc
@@ -14,9 +14,9 @@
mode http
log global
option httplog
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe1
bind "fd@${fe1}"
diff --git a/reg-tests/http-rules/converters_ipmask_concat_strcmp_field_word.vtc b/reg-tests/http-rules/converters_ipmask_concat_strcmp_field_word.vtc
index 6628f36..97469b5 100644
--- a/reg-tests/http-rules/converters_ipmask_concat_strcmp_field_word.vtc
+++ b/reg-tests/http-rules/converters_ipmask_concat_strcmp_field_word.vtc
@@ -74,9 +74,9 @@
mode http
log global
option httplog
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe1
# accept-proxy so test client can send src ip
@@ -129,9 +129,9 @@
mode http
log global
option httplog
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe2
bind "fd@${fe2}"
diff --git a/reg-tests/http-rules/default_rules.vtc b/reg-tests/http-rules/default_rules.vtc
index 3baa33a..f4a8fb9 100644
--- a/reg-tests/http-rules/default_rules.vtc
+++ b/reg-tests/http-rules/default_rules.vtc
@@ -20,9 +20,9 @@
haproxy h1 -conf {
defaults common
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
defaults def_front from common
http-request set-header x-frontend "%[fe_name]"
@@ -60,9 +60,9 @@
haproxy h2 -conf {
defaults common
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
defaults def_front from common
http-request allow
diff --git a/reg-tests/http-rules/del_header.vtc b/reg-tests/http-rules/del_header.vtc
index 32a7a70..0f74a60 100644
--- a/reg-tests/http-rules/del_header.vtc
+++ b/reg-tests/http-rules/del_header.vtc
@@ -36,9 +36,9 @@
haproxy h1 -conf {
defaults
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe
bind "fd@${fe}"
diff --git a/reg-tests/http-rules/except-forwardfor-originalto.vtc b/reg-tests/http-rules/except-forwardfor-originalto.vtc
index bb346dd..a859160 100644
--- a/reg-tests/http-rules/except-forwardfor-originalto.vtc
+++ b/reg-tests/http-rules/except-forwardfor-originalto.vtc
@@ -15,9 +15,9 @@
defaults
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe1
bind "fd@${fe1}"
diff --git a/reg-tests/http-rules/h1_to_h1c.vtc b/reg-tests/http-rules/h1_to_h1c.vtc
index 5ae1f93..9ae73f7 100644
--- a/reg-tests/http-rules/h1_to_h1c.vtc
+++ b/reg-tests/http-rules/h1_to_h1c.vtc
@@ -38,9 +38,9 @@
haproxy h1 -conf {
defaults
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe
bind "fd@${fe}"
diff --git a/reg-tests/http-rules/h1or2_to_h1c.vtc b/reg-tests/http-rules/h1or2_to_h1c.vtc
index 4263a2a..9e7eb60 100644
--- a/reg-tests/http-rules/h1or2_to_h1c.vtc
+++ b/reg-tests/http-rules/h1or2_to_h1c.vtc
@@ -38,9 +38,9 @@
haproxy h1 -conf {
defaults
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe
bind "fd@${feh1}"
diff --git a/reg-tests/http-rules/http_after_response.vtc b/reg-tests/http-rules/http_after_response.vtc
index af66498..7e8cc1d 100644
--- a/reg-tests/http-rules/http_after_response.vtc
+++ b/reg-tests/http-rules/http_after_response.vtc
@@ -22,9 +22,9 @@
haproxy h1 -conf {
defaults
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe
bind "fd@${feh1}"
diff --git a/reg-tests/http-rules/http_return.vtc b/reg-tests/http-rules/http_return.vtc
index 8189028..ae96775 100644
--- a/reg-tests/http-rules/http_return.vtc
+++ b/reg-tests/http-rules/http_return.vtc
@@ -14,9 +14,9 @@
defaults
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe1
bind "fd@${fe1}"
diff --git a/reg-tests/http-rules/map_redirect.vtc b/reg-tests/http-rules/map_redirect.vtc
index 67b586b..f55e0d8 100644
--- a/reg-tests/http-rules/map_redirect.vtc
+++ b/reg-tests/http-rules/map_redirect.vtc
@@ -36,9 +36,9 @@
mode http
log global
option httplog
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe1
bind "fd@${fe1}"
diff --git a/reg-tests/http-rules/map_regm_with_backref.vtc b/reg-tests/http-rules/map_regm_with_backref.vtc
index 78af447..c3b21fb 100644
--- a/reg-tests/http-rules/map_regm_with_backref.vtc
+++ b/reg-tests/http-rules/map_regm_with_backref.vtc
@@ -40,9 +40,9 @@
mode http
log global
option httplog
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe1
bind "fd@${fe1}"
diff --git a/reg-tests/http-rules/normalize_uri.vtc b/reg-tests/http-rules/normalize_uri.vtc
index 7e2d749..129a4b1 100644
--- a/reg-tests/http-rules/normalize_uri.vtc
+++ b/reg-tests/http-rules/normalize_uri.vtc
@@ -20,9 +20,9 @@
defaults
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe_path_merge_slashes
bind "fd@${fe_path_merge_slashes}"
diff --git a/reg-tests/http-rules/path_and_pathq.vtc b/reg-tests/http-rules/path_and_pathq.vtc
index ce697ca..31e85be 100644
--- a/reg-tests/http-rules/path_and_pathq.vtc
+++ b/reg-tests/http-rules/path_and_pathq.vtc
@@ -28,9 +28,9 @@
haproxy h1 -conf {
defaults
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend fe
bind "fd@${fe}"
diff --git a/reg-tests/http-rules/strict_rw_mode.vtc b/reg-tests/http-rules/strict_rw_mode.vtc
index acd2c24..14e6901 100644
--- a/reg-tests/http-rules/strict_rw_mode.vtc
+++ b/reg-tests/http-rules/strict_rw_mode.vtc
@@ -68,9 +68,9 @@
defaults
mode http
- timeout connect 1s
- timeout client 1s
- timeout server 1s
+ timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+ timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
option http-buffer-request
frontend fe1