apache / apache/maven-surefire

[SUREFIRE-1887] Test Failures should not dump stack.

Open
#2,986 2 comments 0 reactions 1 assignee Claimed by @mthmulders View on GitHub
bug priority:major
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

**[Elliotte Rusty Harold](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=elharo)** opened **[SUREFIRE-1887](https://issues.apache.org/jira/browse/SUREFIRE-1887?redirect=false)** and commented

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:**
- [image-2022-10-29-12-56-00-008.png](https://issues.apache.org/jira/secure/attachment/13051598/image-2022-10-29-12-56-00-008.png) (_36.70 kB_)
- [image-2022-10-29-12-56-10-482.png](https://issues.apache.org/jira/secure/attachment/13051597/image-2022-10-29-12-56-10-482.png) (_809.43 kB_)
- [image-2022-10-29-12-57-02-825.png](https://issues.apache.org/jira/secure/attachment/13051596/image-2022-10-29-12-57-02-825.png) (_809.43 kB_)
- [image-2022-10-29-13-01-36-151.png](https://issues.apache.org/jira/secure/attachment/13051599/image-2022-10-29-13-01-36-151.png) (_49.45 kB_)
- [maven-surefire-test-project.zip](https://issues.apache.org/jira/secure/attachment/13051595/maven-surefire-test-project.zip) (_41.96 kB_)

**Remote Links:**
- [GitHub Pull Request #574
](https://github.com/apache/maven-surefire/pull/574)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.