commit 0ed2684eb8e5aafc1eabac21f52475203c883913 Author: Chris Heisterkamp Date: Thu Jul 21 09:55:29 2016 -0700 Enable autoFlush for JUnit printstream so we get output as the tests run Without autoFlush the buffer is never flushed and we get no output during the test run. Testing Done: Travis CI: https://travis-ci.org/pantsbuild/pants/builds/146186132 And installing the new junit-runner.jar and running java tests in the Pants repo. In regards to the speedup in https://rbcommons.com/s/twitter/r/4101/ The tests are not as fast with the autoFlush enabled but hopefully they are fast enough? ``` $ ./pants test.junit tests/java/org/pantsbuild/tools/junit/impl/:: ... 11:40:57 00:15 [run] Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option UseSplitVerifier; support was removed in 8.0 Auto-detected 8 processors, using -parallel-threads=8 ........................................................................................................................................................................................................................................................................................................................................................................................ Time: 148.382 OK (376 tests) ``` Bugs closed: 3698 Reviewed at https://rbcommons.com/s/twitter/r/4102/ src/java/org/pantsbuild/tools/junit/impl/ConsoleRunnerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit ee72a903e57cfac8aea2a2ec6b5b010a1b9047d0 Author: John Sirois Date: Tue Jul 19 20:24:13 2016 -0600 Buffer the ConsoleRunner's use of stdio. This results in drastic speed gains for tests that do alot of stdio. Testing Done: Locally before: ``` $ ./pants test.junit tests/java/org/pantsbuild/tools/junit/impl/:: ... 15:47:50 00:01 [junit] 15:47:50 00:01 [run] OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 OpenJDK 64-Bit Server VM warning: ignoring option UseSplitVerifier; support was removed in 8.0 Auto-detected 8 processors, using -parallel-threads=8 ......................................................................................................................................................................................................................................................................................................................................................................FATAL: VM exiting uncleanly. FAILURE: Timeout of 180 seconds reached ``` And after always green between 50 and 52 seconds. CI went green here: http://jenkins.pantsbuild.org/job/pantsbuild/job/pants/job/PR-3696/1/ Bugs closed: 3684, 3696 Reviewed at https://rbcommons.com/s/twitter/r/4101/ src/java/org/pantsbuild/tools/junit/impl/ConsoleRunnerImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit f1c708e0dc4b9780fbcc34d18611247e20f7c55d Author: Chris Heisterkamp Date: Tue Jul 19 16:18:46 2016 -0700 Fix JUnit -fail-fast, add test for early exit hook and remove unused code Replace AbortableListner with ShutdownListener because the AbortableListener did not work with -fail-fast but we still want to keep the functionality of displaying a test summary if the tests are shutdown unexpectedly and add an integration test for the ShutdownListener. Remove ForwardingListener and ListenerRegistry because they were only being used by the AbortableListener but also had a bug when one listener threw an exception none of the rest of the listeners would get executed. An example of this is what caused the need for https://rbcommons.com/s/twitter/r/4060/ Instead of the fix from https://rbcommons.com/s/twitter/r/4060/, move the testRunFinishFailed test to JUnitConsoleImplTest.java where we can more easily test the output and fix the problem in the ConsoleListener instead. Add a FailFastListener and FailFastRunner so -fail-fast returns a better test summary and add a test for it. Remove exitStatus from ConsoleRunnerImpl because it is unused and fix some typos and deprecation warnings in related JUnitConsole classes. Move the output mode tests from integration tests to the ConsoleRunnerImpl because they can be unit tested instead of using the full integration setup. Add test for -per-test-timer Testing Done: Travis CI: https://travis-ci.org/pantsbuild/pants/builds/145736212 Bugs closed: 3672 Reviewed at https://rbcommons.com/s/twitter/r/4081/ .../junit/impl/AntJunitXmlReportListener.java | 2 +- .../tools/junit/impl/ConsoleListener.java | 16 ++- .../tools/junit/impl/ConsoleRunnerImpl.java | 138 ++++++++++++--------- .../tools/junit/impl/PerTestConsoleListener.java | 4 +- .../tools/junit/impl/ShutdownListener.java | 73 +++++++++++ 5 files changed, 170 insertions(+), 63 deletions(-) commit 8e1907efcd4424db03518d59d2bb81bc7e62664d Author: John Sirois Date: Mon Jul 18 16:50:04 2016 -0600 Simplify `ConcurrentRunnerScheduler` & cleanup. The intermediary `CompletionService` and `concurrentTasks` queue were un-needed. This excises both in favor of leveraging the contracts of `ExecutorService` and ensures cleanup of the `ExecutorService` as well, which prevents hundreds of threads being spawned and not joined in unit tests. Testing Done: Tested locally with a local `~/.m2/repository` publish of the junit tool jar and repeated `jstack` invocations confirmed a steady state of 0 "concurrent-junit-runner-*" threads vs the 100s observed previously. CI went green here: https://travis-ci.org/pantsbuild/pants/builds/145661315 Bugs closed: 3684, 3686 Reviewed at https://rbcommons.com/s/twitter/r/4091/ .../junit/impl/ConcurrentRunnerScheduler.java | 37 ++++++++-------------- 1 file changed, 14 insertions(+), 23 deletions(-)