Test Order & Concurrency #75
Closed
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.
This arose from discussion
Edit: Summary
duckdb-python tests "pollute" the global state by: modifying the default duckdb connection, using local file names that aren't randomized, or otherwise break if run in the "wrong" order.
This PR fixes that:
This PR also ensures that test dependencies aren't introduced by randomizing their order & parallelizing their running.
PR
While running tests for free-threading, I found some test "contamination": tests that are order-dependent or lack isolation of resources.
* This PR makes no functional changes, only changes to tests / testing.
This PR addresses the individual tests and adds steps to detect in the future:
Added Plugins
pytest-xdist
Disabled by default. This PR adds
-n 2
to packaging_wheels to run two parallel tests at a time.Comments:
-n auto
was surprisingly fine. I believe Runners on public repos are 4 cores.-n 2
as a first step in case any issues with the more performance intensive tests.-n
.pytest-randomly
Enabled by default. Randomizes the order of tests.
Comments: