Tibor17 commented on a change in pull request #333: URL: https://github.com/apache/maven-surefire/pull/333#discussion_r567079918
########## File path: maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java ########## @@ -156,4 +156,59 @@ public void shouldHandleTestFailure() throws Exception + "for the individual test results.\nPlease refer to dump files (if any exist) " + "[date].dump, [date]-jvmRun[N].dump and [date].dumpstream.'" ); } + + @Test + public void failsIfThereAreTooManyFlakes() throws Exception + { + RunResult summary = new RunResult( 1, 0, 0, 0, 1 ); + Mojo reportParameters = new Mojo(); + reportParameters.setFailOnFlakeCount( 1 ); + try + { + reportExecution( reportParameters, summary, null, null ); + } + catch ( MojoFailureException e ) + { + assertThat( e.getLocalizedMessage() ) + .isEqualTo( "There are too many flakes.\n\nPlease refer to null " + + "for the individual test results.\nPlease refer to dump files (if any exist) " + + "[date].dump, [date]-jvmRun[N].dump and [date].dumpstream." ); + return; + } + fail( "Expected MojoFailureException with message " Review comment: @oehme Pls move this line right after the line 168, and remove the `return`. It would behave the same, We normally do it this way. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org