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

NPE when Description is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.22.2, 3.0.0-M7
    • None
    • Maven Surefire Plugin
    • None
    • Platform: Java 8
      Build tool: maven 3.8.3 (version is not important), maven-surefire-plugin + surefire-junit47 provider
      Framework: spring-boot 2.5.12, junit-vintage-engine 5.7.2, JUnit 4.13.2
      JUnitParams: 1.1.1

    Description

      using maven-surefire-plugin + surefire-junit47 provider.

      pom.xml: 

           <pluginManagement>
               <plugins>
                   <plugin>
                       <groupId>org.apache.maven.plugins</groupId>
                       <artifactId>maven-surefire-plugin</artifactId>
                       <version>3.0.0-M7</version>
                       <dependencies>
                           <dependency>
                               <groupId>org.apache.maven.surefire</groupId>
                               <artifactId>surefire-junit47</artifactId>
                               <version>3.0.0-M7</version>
                           </dependency>
                       </dependencies>
                   </plugin>
               </plugins>
           </pluginManagement>

      if null is passed as description in the NonConcurrentRunListener.describesNewTestSet(), then the test run (mvn test) will fail. This situation sometimes occurs when working with JUnitParams.

      If you use the default provider (delete the "dependencies" section), then there is no error, everything is ok. This suggests that different providers behave differently, but it seems that the behavior should be unified and without errors.

      It is also not clear from the log on which test the crash occurred.

      -------------------------

      the maven log:

      -------------------------

      [INFO] 
      [INFO] Results:
      [INFO] 
      [INFO] Tests run: 5735, Failures: 0, Errors: 0, Skipped: 0
      [INFO] 
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  05:20 min
      [INFO] Finished at: 2022-06-14T11:25:24+03:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7:test (default-test) on project ...: 
      [ERROR] 
      [ERROR] Please refer to ...\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 :: null
      [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
      [ERROR] Test mechanism :: null
      [ERROR]     at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:701)
      [ERROR]     at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:311)
      [ERROR]     at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:268)
      [ERROR]     at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1334)
      [ERROR]     at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1167)
      [ERROR]     at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:931)
      [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:972)
      [ERROR]     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293)
      [ERROR]     at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)
      [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] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

       

      -------------------------

      the JvmRun.dmp:*

      -------------------------

      org.apache.maven.surefire.api.testset.TestSetFailedException: Test mechanism :: null
          at org.apache.maven.surefire.common.junit4.JUnit4RunListener.rethrowAnyTestMechanismFailures(JUnit4RunListener.java:226)
          at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:138)
          at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:107)
          at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:83)
          at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75)
          at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:158)
          at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
          at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
          at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
          at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)
      Caused by: java.lang.NullPointerException
          at org.apache.maven.surefire.junitcore.NonConcurrentRunListener.describesNewTestSet(NonConcurrentRunListener.java:101)
          at org.apache.maven.surefire.junitcore.NonConcurrentRunListener.finishLastTestSetIfNecessary(NonConcurrentRunListener.java:85)
          at org.apache.maven.surefire.junitcore.NonConcurrentRunListener.testStarted(NonConcurrentRunListener.java:79)
          at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:80)
          at org.junit.runner.notification.RunNotifier$5.notifyListener(RunNotifier.java:156)
          at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
          at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:153)
          at org.apache.maven.surefire.common.junit4.Notifier.fireTestStarted(Notifier.java:100)
          at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:42)
          at junitparams.internal.ParameterisedTestMethodRunner.runMethodInvoker(ParameterisedTestMethodRunner.java:45)
          at junitparams.internal.ParameterisedTestMethodRunner.runTestMethod(ParameterisedTestMethodRunner.java:40)
          at junitparams.internal.ParameterisedTestClassRunner.runParameterisedTest(ParameterisedTestClassRunner.java:146)
          at junitparams.JUnitParamsRunner.runChild(JUnitParamsRunner.java:446)
          at junitparams.JUnitParamsRunner.runChild(JUnitParamsRunner.java:393)
          at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
          at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
          at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
          at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
          at org.junit.runners.Suite.runChild(Suite.java:128)
          at org.junit.runners.Suite.runChild(Suite.java:27)
          at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
          at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
          at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
          at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
          at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:55)
          at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137)
          ... 8 more

      Attachments

        Activity

          People

            Unassigned Unassigned
            vlalykin victor lalykin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: