Giter Club home page Giter Club logo

Comments (8)

adamchainz avatar adamchainz commented on September 7, 2024 1

Thanks @thedrow . Will close this issue then.

from pytest-randomly.

adamchainz avatar adamchainz commented on September 7, 2024 1

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.

adamchainz avatar adamchainz commented on September 7, 2024 1

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.

adamchainz avatar adamchainz commented on September 7, 2024

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.

thedrow avatar thedrow commented on September 7, 2024

Seems like xdist works in 1.31.0.

from pytest-randomly.

nodakai avatar nodakai commented on September 7, 2024

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.

therefromhere avatar therefromhere commented on September 7, 2024

Awesome!

from pytest-randomly.

fermezz avatar fermezz commented on September 7, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.