Commit dfd1908
authored
Use pytest-xdist
The pytest-xdist module has options to control dynamic workload
distribution. The default does not always produce the fastest run times.
Some exploration of alternatives revealed that using the option `--dist
worksteal` yields faster pytest runs. The "worksteal" mode reassigns
tests from less busy workers to idle ones to optimize fixture reuse and
handle varying test durations. In worksteal mode, when a worker is
nearly idle (fewer than two tests left in its queue), it "steals"
pending tests from busier workers.
This PR adds the option `--dist worksteal` to `tool.pytest.ini_options`
in `pyproject.toml`. This results in an almost 25% improvement in
execution time over the default pytest-xdist value for the dist option
(which is `--dist load`).--dist worksteal option to speed up Pytest runs (#8366)1 parent ca684ed commit dfd1908
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
| |||
0 commit comments