Adds the ability to run methods within a class in parallel during testing - Add a -parallel-methods flag to junit runner - Add a unit test

Review Request #3696 — Created April 15, 2016 and submitted

3191, 3202
gmalmquist, patricklaw, stuhood

The current model of parallel execution of tests parallelizes the running of classes. This change also allows methods within a test class to run in parallel by passing a -parallel-methods flag to the junit runner.

A followon patch will add this capability into pants proper. I think we will add an option to test.junit, but we can also add an attribute of a junit_tests() target to allow controlling this value.

I experimented with adding a @TestParallelMethods annotation, but it got complicated. This basic functionality seems to be working so I wanted to float it first.

CI build at

  1. Great! Nice test-cases.

  2. Do you need the 'this.' here?

  3. I'm not sure this rename makes sense. The method is still testing whether the class is a Junit Test-like class, not whether the class is testable or not.

    1. I'll revert it. It made more sense when I had a second test to see if it the class was to be testable as parallel methods (for supporting @TestParallelMethods) but I backed that out.

  1. Ship It!
Review request changed

Status: Closed (submitted)

Change Summary:

Thanks Garrett, Chris and Benjy. Commit 2024b5f