pytest-dev / pytest-random-order

pytest plugin to randomise the order of tests with some control over the randomness
MIT License
67 stars 10 forks source link

Seed is not consistent in different xdist processes if not specified on the command line #49

Closed boatcoder closed 9 months ago

boatcoder commented 1 year ago

using just the param --random-order-bucket=global results in pytest-xdist failing to start. I'm assuming this is because the seed is picked once per process. When I add --random-order-seed=133 this problem does not happen. Seems like the default seed should be passed to each process but not sure how that would happen. Maybe if seed is not specified, bucketing is, and xdist is present then an error message should be printed?

Right now the error message that is printed is: Different tests were collected between gw3 and gw0

jbasko commented 1 year ago

Does this suggestion address your issue: https://github.com/jbasko/pytest-random-order/issues/46#issuecomment-1276533028 ?

jbasko commented 1 year ago

@boatcoder Forgot to mention here, I did a release over the weekend that solves the xdist issue. Try v1.1.0 and let me know here if it solves the issue.