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
Add Collections#shuffle(List) to forbidden APIs #15287
Comments
+1 |
The list for tests or the list for all classes? |
I intend to completely forbid it lest there still remain non-reproducible sources of randomness. I discussed this with @rmuir and we have a path forward. |
its the only way. if something is non-test and uses random behavior, give it an optional setting like initialSeed and set it in the test framework. |
I figured as much but its nice to have it confirmed. IIRC its used in a few places. |
This method is also used inside ESTestCase#randomSubsetOf greatly increasing the surface area of non-reproducible tests. |
Several tests are using
Collections#shuffle(List)
which uses a default source of randomness rather than usingCollections#shuffle(List, Random)
which enables a reproducible source of randomness. This prevents reproducible build failures. One example is NodeJoinControllerTests but there are many others.The method
Collections#shuffle(List)
should be added to forbidden APIs.The text was updated successfully, but these errors were encountered: