Skip to content

Deterministically randomises test compilation order #2193

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

Merged
merged 2 commits into from
Apr 6, 2017

Conversation

OlivierBlanvillain
Copy link
Contributor

The previous implementation would compile tests in different orders from machine to machine, depending on the order in which *.scala files are listed by the operating system.

val files = {
// Deterministically randomises compilation order
Random.setSeed(seed)
Random.shuffle(flatten(sourceDir).toList).toArray
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some other thread could mess with the global instance of Random. You should use a new instance of Random in here.

The previous implementation would compile tests in different orders from machine to machine, depending on the order in which *.scala files are listed by the operating system.
@felixmulder felixmulder merged commit 4d76265 into scala:master Apr 6, 2017
@felixmulder
Copy link
Contributor

🎉

@OlivierBlanvillain OlivierBlanvillain deleted the deterministic-tests branch April 7, 2017 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants