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
This commit is contained in:
Clark Boylan 2024-01-02 08:34:05 -08:00 committed by Clark Boylan
parent f7217bed63
commit 511cc0e4e4
1 changed files with 11 additions and 0 deletions

View File

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