mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-16 08:24:42 +00:00
f673923629
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.
117 lines
3.1 KiB
Plaintext
117 lines
3.1 KiB
Plaintext
vtest "Basic test for peers protocol stick-table declared in peers sections"
|
|
feature ignore_unknown_macro
|
|
|
|
#REQUIRE_VERSION=2.0
|
|
#REGTEST_TYPE=slow
|
|
|
|
haproxy h1 -arg "-L A" -conf {
|
|
defaults
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
|
|
peers peers
|
|
bind "fd@${A}"
|
|
server A
|
|
server B ${h2_B_addr}:${h2_B_port}
|
|
server C ${h3_C_addr}:${h3_C_port}
|
|
table stkt type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000)
|
|
|
|
frontend fe
|
|
bind "fd@${fe}"
|
|
tcp-request inspect-delay 100ms
|
|
tcp-request content track-sc0 url table peers/stkt
|
|
tcp-request content sc-inc-gpc0(0)
|
|
}
|
|
|
|
haproxy h2 -arg "-L B" -conf {
|
|
defaults
|
|
mode http
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
peers peers
|
|
bind "fd@${B}"
|
|
server A ${h1_A_addr}:${h1_A_port}
|
|
server B
|
|
server C ${h3_C_addr}:${h3_C_port}
|
|
table stkt type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000)
|
|
|
|
frontend fe
|
|
bind "fd@${fe}"
|
|
http-request track-sc0 url table peers/stkt
|
|
http-request sc-inc-gpc0(0)
|
|
}
|
|
|
|
haproxy h3 -arg "-L C" -conf {
|
|
defaults
|
|
mode http
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
peers peers
|
|
bind "fd@${C}"
|
|
server A ${h1_A_addr}:${h1_A_port}
|
|
server B ${h2_B_addr}:${h2_B_port}
|
|
server C
|
|
table stkt type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000)
|
|
|
|
frontend fe
|
|
bind "fd@${fe}"
|
|
http-request track-sc0 url table peers/stkt
|
|
http-request sc-inc-gpc0(0)
|
|
}
|
|
|
|
client c1 -connect ${h1_fe_sock} {
|
|
txreq -url "/c1_client"
|
|
expect_close
|
|
} -start
|
|
|
|
client c2 -connect ${h1_fe_sock} {
|
|
txreq -url "/c2_client"
|
|
expect_close
|
|
} -start
|
|
|
|
client c3 -connect ${h1_fe_sock} {
|
|
txreq -url "/c3_client"
|
|
expect_close
|
|
} -start
|
|
|
|
client c4 -connect ${h1_fe_sock} {
|
|
txreq -url "/c4_client"
|
|
expect_close
|
|
} -start
|
|
|
|
haproxy h1 -start
|
|
delay 0.2
|
|
haproxy h2 -start
|
|
delay 0.2
|
|
haproxy h3 -start
|
|
delay 0.2
|
|
|
|
client c1 -wait
|
|
client c2 -wait
|
|
client c3 -wait
|
|
client c4 -wait
|
|
|
|
delay 2
|
|
|
|
haproxy h1 -cli {
|
|
send "show table peers/stkt"
|
|
expect ~ "# table: peers/stkt, type: string, size:1048[0-9]{4}, used:4(\n0x[0-9a-f]*: key=/c[1-4]_client use=0 exp=0 server_id=0 gpc0=1 conn_rate\\(50000\\)=1 conn_cur=0){4}"
|
|
}
|
|
|
|
haproxy h2 -cli {
|
|
send "show table peers/stkt"
|
|
expect ~ "# table: peers/stkt, type: string, size:1048[0-9]{4}, used:4(\n0x[0-9a-f]*: key=/c[1-4]_client use=0 exp=0 server_id=0 gpc0=1 conn_rate\\(50000\\)=1 conn_cur=0){4}"
|
|
}
|
|
|
|
haproxy h3 -cli {
|
|
send "show table peers/stkt"
|
|
expect ~ "# table: peers/stkt, type: string, size:1048[0-9]{4}, used:4(\n0x[0-9a-f]*: key=/c[1-4]_client use=0 exp=0 server_id=0 gpc0=1 conn_rate\\(50000\\)=1 conn_cur=0){4}"
|
|
}
|
|
|