Skip to content

tests: add k6 stress and resilience suite - #3722

Merged
benoitc merged 1 commit into
masterfrom
tests/stress-suite
Sep 1, 2026
Merged

tests: add k6 stress and resilience suite#3722
benoitc merged 1 commit into
masterfrom
tests/stress-suite

Conversation

@benoitc

@benoitc benoitc commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Adds a docker suite at tests/docker/stress/ that drives real load at the WSGI (sync, gthread, gevent) and native ASGI workers with k6, direct and behind nginx, over HTTP/1.1, TLS HTTP/2, WebSocket, and uwsgi_pass, and asserts correctness under load: zero failed requests, intact bodies and checksums, the negotiated protocol, echoed request ids, and no worker tracebacks. k6 and toxiproxy run as pinned container images; no Grafana Cloud, nothing installed on the host.

One env-driven gunicorn image serves every worker/topology, so every worker/topology/protocol/profile is selectable by environment. The six-config smoke matrix is wired and gates CI (new stress-smoke job); resilience (worker kill, HUP, TTIN/TTOU, graceful) and toxiproxy fault scenarios are gated behind GUNICORN_STRESS_HEAVY and run nightly (stress-nightly.yml).

No gunicorn code changes. The uwsgi_pass topology uses the sync worker: the asgi worker's uWSGI parser fails behind nginx uwsgi_pass (502, Invalid uWSGI header: incomplete header), tracked separately.

Run with PYTEST=".venv/bin/python -m pytest" scripts/run_docker_tests.sh stress.

Drive real load at the WSGI (sync, gthread, gevent) and native ASGI workers
with k6, direct and behind nginx, over HTTP/1.1, TLS HTTP/2, WebSocket, and
uwsgi_pass, and assert correctness under load: zero failed requests, intact
bodies and checksums, the negotiated protocol, echoed request ids, and no
worker tracebacks. k6 and toxiproxy run as pinned container images.

The smoke matrix (six representative configs) is wired and verified and gates
CI; every worker/topology/protocol/profile is selectable by environment.
Resilience (worker kill, HUP, TTIN/TTOU, graceful) and toxiproxy fault
scenarios are gated behind GUNICORN_STRESS_HEAVY and run nightly. No gunicorn
code changes; the uwsgi_pass topology uses the supported sync worker.
@benoitc
benoitc merged commit 7a7d2f2 into master Sep 1, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant