Comments (8)
Thanks @thedrow . Will close this issue then.
from pytest-randomly.
Thanks for the example @nodakai . With that I was able to figure out what the problem was - the workers would sometimes not share the same default seed, since it's based on int(time.time())
and sometimes workers would start across the second boundary. This is, of course, a random error π
Fixed in #245 and released in version 3.3.0 ! π²π
from pytest-randomly.
I don't work with Python 2.7 more (at least, for free). If you want a backport please fork, cherry-pick the commit, and pip install from your repo.
from pytest-randomly.
We don't currently test with xdist, if you are working on this I think it'd be good to have some tests here using it.
from pytest-randomly.
Seems like xdist works in 1.31.0.
from pytest-randomly.
No, the issue is still there (I'm not saying pytest-randomly has to do anything for this issue but just for the sake of recoding...)
test/test_0.py
def test_a(): pass
test/test_1.py
def test_b(): pass
$ while pytest -d --tx 2*popen test; do sleep 1; done
(after several successes...)
========================================== test session starts ===========================================
platform linux -- Python 3.7.6, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
Using --randomly-seed=1586915652
rootdir: /home/kai/tst
plugins: forked-1.1.3, randomly-3.2.1, xdist-1.31.0
gw0 [2] / gw1 [2]
collecting 0 items / 1 error
================================================= ERRORS =================================================
__________________________________________ ERROR collecting gw1 __________________________________________
Different tests were collected between gw0 and gw1. The difference is:
--- gw0
+++ gw1
@@ -1,2 +1,2 @@
+test/test_0.py::test_a
test/test_1.py::test_b
-test/test_0.py::test_a
======================================== short test summary info =========================================
ERROR gw1
============================================ 1 error in 0.37s ============================================
There's some indeterminacy here
from pytest-randomly.
Awesome!
from pytest-randomly.
@adamchainz would you guys be open to a contribution backporting this fix into the 1.2.x
branch? Since pytest-dev/pytest#6870 was merged, now pytest-randomly
on version 1.2.x
βthe one compatible with Python2β is incompatible with pytest
version >=4.6.10
from pytest-randomly.
Related Issues (20)
- Incompatible with `pytest-mypy-plugins` (3.10 version) HOT 2
- Support for enabling/disabling test seeding in specific tests. HOT 5
- AttributeError: 'Config' object has no attribute 'cache' with cacheprovider disabled HOT 4
- hashlib.md5 doesn't work when FIPS is enabled HOT 3
- Test suite failures mostly on tests checking ordering HOT 1
- Test numpy on Python 3.11
- 3.12.0: pytest is failing in two units HOT 1
- Support for time getters HOT 1
- Shuffle inside modules only mode HOT 2
- Disabling entry points from dependencies HOT 3
- sdist is missing tests HOT 6
- Random seed appears to also seed other random() calls HOT 10
- Test failures with pytest 7.3.0: Possible off-by-one line fragment mismatch? HOT 3
- Feature enhancement to allow turning plugin on and off HOT 4
- Support numpy.random.default_rng HOT 4
- Add default support for baker random seeding HOT 1
- RFE: please start making github releases HOT 1
- provide unique seed to each test HOT 7
- 3.15.0: pytest fails in 3 units HOT 3
- Integration with pytest-rerunfailures HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-randomly.