tests: add k6 stress and resilience suite - #3722
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, anduwsgi_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-smokejob); resilience (worker kill, HUP, TTIN/TTOU, graceful) and toxiproxy fault scenarios are gated behindGUNICORN_STRESS_HEAVYand run nightly (stress-nightly.yml).No gunicorn code changes. The
uwsgi_passtopology uses the sync worker: the asgi worker's uWSGI parser fails behind nginxuwsgi_pass(502,Invalid uWSGI header: incomplete header), tracked separately.Run with
PYTEST=".venv/bin/python -m pytest" scripts/run_docker_tests.sh stress.