You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Elliotte Rusty Harold (Jira)" <ji...@apache.org> on 2022/12/09 12:51:00 UTC

[jira] [Commented] (SUREFIRE-1887) Test Failures should not dump stack.

    [ https://issues.apache.org/jira/browse/SUREFIRE-1887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17645287#comment-17645287 ] 

Elliotte Rusty Harold commented on SUREFIRE-1887:
-------------------------------------------------

I don't think this is right. Per docs, trimStackTrace controls "Whether to trim the stack trace in the reports to just the lines within the test, or show the full trace." However SUREFIRE-1887 is about something different, removing the lines from the framework code, not the user's own code. I'm not sure we can change the existing option to make that possible. It might need a new option instead. 

> Test Failures should not dump stack. 
> -------------------------------------
>
>                 Key: SUREFIRE-1887
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1887
>             Project: Maven Surefire
>          Issue Type: Bug
>            Reporter: Elliotte Rusty Harold
>            Assignee: Maarten Mulders
>            Priority: Major
>         Attachments: image-2022-10-29-12-56-00-008.png, image-2022-10-29-12-56-10-482.png, image-2022-10-29-12-57-02-825.png, image-2022-10-29-13-01-36-151.png, maven-surefire-test-project.zip
>
>
> 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.
> ```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)