Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1887

Test Failures should not dump stack.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Typical failing test output from the Maven surefire plugin dumps a lot of internal state. This is incorrect.

       

      The purpose of the surefire plugin is to run the user's tests. These tests are expected to fail much of the time. This a normal state. The test failure should be reported, but this is in no way a failure of surefire itself. There is no reason surefire should print its own stack. Indeed, this simply obscures the real failure in the user's own code.

       

      ```

      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project dependencies: There are test failures.

      Please refer to /home/runner/work/cloud-opensource-java/cloud-opensource-java/dependencies/target/surefire-reports for the individual test results.
      Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
      at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
      at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
      Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

      ```

      Attachments

        1. image-2022-10-29-12-56-00-008.png
          37 kB
          Peter Wessels
        2. image-2022-10-29-12-56-10-482.png
          809 kB
          Peter Wessels
        3. image-2022-10-29-12-57-02-825.png
          809 kB
          Peter Wessels
        4. image-2022-10-29-13-01-36-151.png
          49 kB
          Peter Wessels
        5. maven-surefire-test-project.zip
          42 kB
          Peter Wessels

        Issue Links

          Activity

            People

              mthmulders Maarten Mulders
              elharo Elliotte Rusty Harold
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: