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}\'')