[ https://issues.apache.org/jira/browse/SUREFIRE-1946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17465845#comment-17465845 ]
Tibor Digana edited comment on SUREFIRE-1946 at 12/27/21, 7:03 PM: ------------------------------------------------------------------- [~fl4via] This issue should be handled different way. This stack trace should be analyzed and the question should be answered: who caused the NPE. Was it the test frameworks or Surefire Provider? {noformat} [ERROR] org.apache.maven.surefire.api.testset.TestSetFailedException: Test mechanism :: java.lang.NullPointerException [ERROR] at org.apache.maven.surefire.common.junit4.JUnit4RunListener.rethrowAnyTestMechanismFailures(JUnit4RunListener.java:192) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:138) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:107) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:83) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:157) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:436) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:170) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:570) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:556) [ERROR] Caused by: java.lang.RuntimeException: java.lang.NullPointerException [ERROR] at io.undertow.testutils.DefaultServer.stopServer(DefaultServer.java:549) [ERROR] at io.undertow.testutils.RunDefaultServer$1.testRunFinished(RunDefaultServer.java:69) [ERROR] at org.junit.runner.notification.SynchronizedRunListener.testRunFinished(SynchronizedRunListener.java:42) [ERROR] at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:103) [ERROR] at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72) [ERROR] at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:100) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:63) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137) [ERROR] ... 8 more [ERROR] Caused by: java.lang.NullPointerException [ERROR] at io.undertow.testutils.StopServerWithExternalWorkerUtils.stopWorker(StopServerWithExternalWorkerUtils.java:83) [ERROR] at io.undertow.testutils.DefaultServer.stopServer(DefaultServer.java:547) {noformat} was (Author: tibor17): [~fl4via] This issue should be handled different way. This stack trace should be analyzed and the question who caused the NPE. Is it the test frameworks or Surefire Provider? {noformat} [ERROR] org.apache.maven.surefire.api.testset.TestSetFailedException: Test mechanism :: java.lang.NullPointerException [ERROR] at org.apache.maven.surefire.common.junit4.JUnit4RunListener.rethrowAnyTestMechanismFailures(JUnit4RunListener.java:192) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:138) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:107) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:83) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:157) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:436) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:170) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:570) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:556) [ERROR] Caused by: java.lang.RuntimeException: java.lang.NullPointerException [ERROR] at io.undertow.testutils.DefaultServer.stopServer(DefaultServer.java:549) [ERROR] at io.undertow.testutils.RunDefaultServer$1.testRunFinished(RunDefaultServer.java:69) [ERROR] at org.junit.runner.notification.SynchronizedRunListener.testRunFinished(SynchronizedRunListener.java:42) [ERROR] at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:103) [ERROR] at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72) [ERROR] at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:100) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:63) [ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137) [ERROR] ... 8 more [ERROR] Caused by: java.lang.NullPointerException [ERROR] at io.undertow.testutils.StopServerWithExternalWorkerUtils.stopWorker(StopServerWithExternalWorkerUtils.java:83) [ERROR] at io.undertow.testutils.DefaultServer.stopServer(DefaultServer.java:547) {noformat} > Stack trace is ommited by ForkStarter.fork if forkClient.isErrorInFork > ---------------------------------------------------------------------- > > Key: SUREFIRE-1946 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1946 > Project: Maven Surefire > Issue Type: Bug > Components: process forking > Affects Versions: 3.0.0-M5 > Reporter: Flavia Rainone > Priority: Major > Labels: waiting-for-feedback > > If there is an error in the fork client (forkClient.isErrorInFork), only the > title of the exception is shown, and without the stack trace that caused that > exception, it is hard to be able to figure what is causing the error. > In my case, I'm getting a NPE, and the output shows solely: > {code:java} > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) > on project undertow-core: There are test failures. > [ERROR] > [ERROR] Please refer to > /home/fla/Development/projects/undertow/core/target/surefire-reports for the > individual test results. > [ERROR] Please refer to dump files (if any exist) [date].dump, > [date]-jvmRun[N].dump and [date].dumpstream. > [ERROR] There was an error in the forked process > [ERROR] Test mechanism :: java.lang.NullPointerException > [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There > was an error in the forked process > [ERROR] Test mechanism :: java.lang.NullPointerException > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932) > [ERROR] at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) > [ERROR] at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) > [ERROR] at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) > [ERROR] at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) > [ERROR] at > org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) > [ERROR] at > org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) > [ERROR] at > org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) > [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) > [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957) > [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289) > [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193) > [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > [ERROR] at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > [ERROR] at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > [ERROR] at java.lang.reflect.Method.invoke(Method.java:498) > [ERROR] at > org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) > [ERROR] at > org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) > [ERROR] at > org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) > [ERROR] at > org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) > [ERROR] > [ERROR] -> [Help 1] > [ERROR] > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)