Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuvalino/pytest-xstress
Stress testing plugin for pytest-xdist.
https://github.com/yuvalino/pytest-xstress
Last synced: 16 days ago
JSON representation
Stress testing plugin for pytest-xdist.
- Host: GitHub
- URL: https://github.com/yuvalino/pytest-xstress
- Owner: yuvalino
- Created: 2024-05-26T21:30:32.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-01T13:42:27.000Z (7 months ago)
- Last Synced: 2024-10-31T05:12:04.261Z (2 months ago)
- Language: Python
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pytest-xstress
custom xdist scheduler that runs all tests infinitely.
## Usage
```sh
$ pytest -nauto --dist loadgroup --xstress
```xstress will switch the `loadgroup` scheduler to its own `loadgroupstress` scheduler that will run tests forever with its scheduling taking the group constraint into account. Such scheduling algorithm will try to be as fair as possible, which means running tests in an evenly distributed manner.
**NOTE:** The `-n` switch is important! Running xdist with only one process effectively runs without test distribution at all.
Example result:
```sh
(pytest-xstress-py3.12) ...@macbookpro pytest-xstress % python3 -m pytest test.py -n2 --dist loadgroup --xstress -v
============================= test session starts ==============================
platform darwin -- Python 3.12.2, pytest-8.2.1, pluggy-1.5.0 -- /Users/.../Library/Caches/pypoetry/virtualenvs/pytest-xstress-M8wNAFyb-py3.12/bin/python3
cachedir: .pytest_cache
rootdir: /Users/.../Development/pytest-xstress
configfile: pyproject.toml
plugins: publish-1.0.0, xstress-1.0.0, xdist-3.6.1
created: 2/2 workerstest.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a
test.py::_test_single@a
[gw0] [100%] PASSED test.py::_test_single@a...
```