https://issues.apache.org/bugzilla/show_bug.cgi?id=55925
Bug ID: 55925
Summary: junit task should support parallel/threads option
Product: Ant
Version: 1.9.2
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Optional Tasks
Assignee: [email protected]
Reporter: [email protected]
Created attachment 31146
--> https://issues.apache.org/bugzilla/attachment.cgi?id=31146&action=edit
Zip file with patch, 5 modified source files to implement junit with parallel
test execution threads
Ant's JUnit task should natively support a "threads" or "parallel" option,
which executes unit tests in parallel in a specified number of threads. The
default if not specified should be 1, which is the current behavior. Given the
set of test to be executed, each of the "n" threads should continue picking off
and executing the 'next' test element until all elements have been executed. I
have made an attempt to implement the feature.
While a possible workaround is to specify a parallel block with multiple JUnit
entries, this forces the burden of breaking the tests down into groups of
roughly equal execution time on the programmer; such blocks may not be
convenient and as the tests evolve and the set grows, the groups are likely to
become uneven unless carefully maintained. This burden should not be
necessary. While 'picking off the next test' doesn't guarantee minimal
execution (the longest test could be the last one) it will generally make a
pretty good improvement.
I have seen one third-party add-on entry into this arena
(http://lmax-exchange.github.io/parallel-junit/), which was a very nice effort.
We got it working but the output was not good - output line ran together,
sometimes were embedded within other lines. I hoped a native implementation
wouldn't have that.
I have attached a patch as well as the 5 modified files in my implementation
attempt, which seems to work well in "per test" execution. I had to add the
test name to the results line, since that line didn't necessarily immediately
follow the "Executing <classname>...". I don't claim to have understood all of
the Ant coding conventions.
--
You are receiving this mail because:
You are the assignee for the bug.