haproxy/reg-tests/seamless-reload/abns_socket.vtc
Willy Tarreau f673923629 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.
2021-11-18 17:57:11 +01:00

55 lines
1.7 KiB
Plaintext

# commit b4dd15b
# BUG/MINOR: unix: Make sure we can transfer abns sockets on seamless reload.
#
# When checking if a socket we got from the parent is suitable for a listener,
# we just checked that the path matched sockname.tmp, however this is
# unsuitable for abns sockets, where we don't have to create a temporary
# file and rename it later.
# To detect that, check that the first character of the sun_path is 0 for
# both, and if so, that &sun_path[1] is the same too.
#
# Note: there are some tricks here. One of them is that we must not bind the
# same abns address to multiple processes that may run in parallel. Since
# vtest cannot provide abns sockets, we're instead concatenating the number
# of the listening port that vtest allocated for another frontend to the abns
# path, which guarantees to make them unique in the system.
varnishtest "Seamless reload issue with abns sockets"
feature ignore_unknown_macro
# abns@ sockets are not available on freebsd
#EXCLUDE_TARGETS=freebsd,osx,generic
#REQUIRE_VERSION=1.8
#REGTEST_TYPE=broken
haproxy h1 -W -conf {
global
stats socket "${tmpdir}/h1/stats" level admin expose-fd listeners
defaults
mode http
log global
option httplog
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
listen testme
bind "fd@${testme}"
server test_abns_server abns@wpproc1_${h1_testme_port} send-proxy-v2
frontend test_abns
bind abns@wpproc1_${h1_testme_port} accept-proxy
http-request deny deny_status 200
} -start
shell {
kill -USR2 $(cat "${tmpdir}/h1/pid")
}
client c1 -connect ${h1_testme_sock} {
txreq -url "/"
rxresp
} -repeat 50 -run