-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClassOrderer.Random
and MethodOrderer.Random
do not use same default seed
#3817
Comments
The default order can be configured separately for classes and methods using the
Where does it state that?
By "both" are you referring to the setting of the default class/method orderer or the custom seed?
Which tests are you referring to? |
that is understood
When I set the ClassOrderer$Random and MethodOrderer$Random as the test class and testmethod order default respectively, the tests log on the CONFIG level the (different) random seeds used. The assumption is they do so to replay a test run with the defined seeds. This is impossible, as both classes use the same configuration key as a custom seed
Indeed now I see, it states here the opposite: junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java Lines 220 to 221 in 2886963
But actually uses two different seeds when running on fallback. This is then the inconsistency
At least I could not find any documentation on how to use |
ClassOrderer.Random
and MethodOrderer.Random
do not use same default seed
Thanks for the explanation, @kurellajunior. 👍
That's an actual bug. I've changed the title of this issue to reflect that, and I've assigned this to the |
Prior to this commit the default seeds were generated separately but the configuration parameter that allows using a fixed seed only allowed to set both to the same value making it impossible to reproduce a failure for different default seeds. Since the default seed is now identical, this scenario is avoided. Fixes #3817.
Prior to this commit the default seeds were generated separately but the configuration parameter that allows using a fixed seed only allowed to set both to the same value making it impossible to reproduce a failure for different default seeds. Since the default seed is now identical, this scenario is avoided. Fixes #3817.
Prior to this commit the default seeds were generated separately but the configuration parameter that allows using a fixed seed only allowed to set both to the same value making it impossible to reproduce a failure for different default seeds. Since the default seed is now identical, this scenario is avoided. Fixes #3817. (cherry picked from commit a422c5a)
The documentation is very misleading. It states, that the seed can be set individually for classes and methods, but neither configuration key is actually used:
ClassOrderer#RANDOM_SEED_PROPERTY_NAME
junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java
Line 78 in 2886963
MethodOrderer#DEFAULT_ORDER_PROPERTY_NAME
junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java
Line 75 in 413ccc0
instead for both random seeds is used
MethodOrderer.Random#RANDOM_SEED_PROPERTY_NAME
junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java
Line 297 in 413ccc0
This is also very inconsistent with the output of the tests which clearly suggests to set the respective seed to a specific value.
I do not know what is tha actual desired behaviour, so cannot provide a PR
The text was updated successfully, but these errors were encountered: