From 511cc0e4e47875e4675322672b467fda2808fd4f Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 2 Jan 2024 08:34:05 -0800 Subject: [PATCH] Test gitea haproxy maxconn limits With the haproxy 2.9.x release we saw that once we hit maxconns on the front end we stopped accepting new requests. Add a testinfra test to ensure that we can process more than maxconn limit requests. Change-Id: Iad70ad8c1d511eb8875ea638d010868c01576426 --- testinfra/test_gitea_lb.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/testinfra/test_gitea_lb.py b/testinfra/test_gitea_lb.py index 69480b0c7b..b44c388435 100644 --- a/testinfra/test_gitea_lb.py +++ b/testinfra/test_gitea_lb.py @@ -35,6 +35,17 @@ def test_haproxy_gitea_connection(host): 'https://opendev.org') assert 'OpenDev: Free Software Needs Free Tools' in cmd.stdout +def test_more_than_haproxy_maxconn_conns(host): + '''Test we can handle more than haproxy maxconn limit for connections''' + # Perform more than 4000 (maxconn limit) requests. + cmd = host.run('bash -c "seq 1 4096 | xargs -IUNUSED -n 1 -P 0 ' + 'curl --resolve opendev.org:443:127.0.0.1 ' + 'https://opendev.org > /dev/null 2>&1"') + # Now make a request and ensure we get expected content back + cmd = host.run('curl --resolve opendev.org:443:127.0.0.1 ' + 'https://opendev.org') + assert 'OpenDev: Free Software Needs Free Tools' in cmd.stdout + def test_haproxy_stats(host): cmd = host.run('echo "show servers state" | socat /var/haproxy/run/stats stdio | ' 'tail +3 | awk \'{print $2,$4,$6}\'')