Skip to content
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

Randomize the order of test cases passed from junit_run.py to junit-runner task #4038

Closed
ericzundel opened this issue Nov 9, 2016 · 0 comments

Comments

@ericzundel
Copy link
Member

@cheister found a couple of flaky tests in our repo in the latest upgrade to 1.2.0. There was a difference between 1.1.0 in the order that test cases were passed to junit-runner.jar that exposed flaky tests.

This gave us an idea that we should be able to pass a flag to randomize the tests and print out the seed so that we can try running tests repeatedly in different order. If they fail, we can re-run them with the same seed in order to debug what's going wrong.

./pants test tests/src/java/com/squareup/foo:: --test-junit-randomize
...
  [test.junit]
     Randomizing tests with seed 1234567

and then, if that fails, run something like:

./pants test  tests/src/java/com/squareup/foo:: --test-junit-randomize --test-junit-random-seed=1234567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants