prashant-ramcharan / courgette-jvm

Multiprocess | Parallel Cucumber-JVM | Parallelize your Java Cucumber tests on a feature level or on a scenario level.
MIT License
130 stars 38 forks source link

mvn verify throws There was an error in the forked process at the end of the test execution using Courgette #335

Closed MadhuQAAutomation closed 2 years ago

MadhuQAAutomation commented 2 years ago

Hi Prashant - While executing the Cucumber tests using Courgette by enabling the parallel (thread count >1), the below error is thrown when the tests has some failures.

There was an error in the forked process org.apache.maven.surefire.testset.TestSetFailedException: java.lang.NullPointerException at org.apache.maven.surefire.common.junit4.JUnit4RunListener.rethrowAnyTestMechanismFailures(JUnit4RunListener.java:209) 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:161) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) Caused by: java.lang.NullPointerException at org.apache.maven.surefire.junitcore.NonConcurrentRunListener.describesNewTestSet(NonConcurrentRunListener.java:93) at org.apache.maven.surefire.junitcore.NonConcurrentRunListener.finishLastTestSetIfNecessary(NonConcurrentRunListener.java:77) at org.apache.maven.surefire.junitcore.NonConcurrentRunListener.testFailure(NonConcurrentRunListener.java:130) at org.junit.runner.notification.SynchronizedRunListener.testFailure(SynchronizedRunListener.java:94) at org.junit.runner.notification.RunNotifier$6.notifyListener(RunNotifier.java:177) at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72) at org.junit.runner.notification.RunNotifier.fireTestFailures(RunNotifier.java:173) at org.junit.runner.notification.RunNotifier.fireTestFailure(RunNotifier.java:167) at org.apache.maven.surefire.common.junit4.Notifier.fireTestFailure(Notifier.java:114) at courgette.runtime.junit.CourgetteJUnitRunner.lambda$notifyTestFailure$1(CourgetteJUnitRunner.java:87) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at courgette.runtime.junit.CourgetteJUnitRunner.notifyTestFailure(CourgetteJUnitRunner.java:84) at courgette.api.junit.Courgette.run(Courgette.java:86) 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) ... 7 more

Surefire Plugin config:

org.apache.maven.plugins maven-surefire-plugin 2.19.1 false true **/runner/CourgetteTestRunner.class org.apache.maven.surefire surefire-junit47 2.19.1
prashant-ramcharan commented 2 years ago

Hi, please provide the following:

  1. The full configuration for your maven surefire plugin.
  2. The Courgette version.
  3. The maven version.
  4. Is this error repeatable?
  5. Have you tried using maven surefire plugin version 3.0.0-M6 or higher?
  6. The output of mvn test -X

Thanks!

MadhuQAAutomation commented 2 years ago

Hi Prashant - Please find the below details :

Surefire Plugin Config :

org.apache.maven.plugins maven-surefire-plugin 2.17 false true **/runner/CourgetteTestRunner.class org.apache.maven.surefire surefire-junit47 2.17

Courgette Version :

io.github.prashant-ramcharan courgette-jvm 6.5.0

Maven Version: 3.8.4

On Wed, Jun 15, 2022 at 12:32 AM Prashant Ramcharan < @.***> wrote:

Hi, please provide the following:

  1. The full configuration for your maven surefire plugin.
  2. The Courgette version.
  3. The maven version.
  4. Is this error repeatable?
  5. Have you tried using maven surefire plugin version 3.0.0-M6 or higher?
  6. The output of mvn test -X

Thanks!

— Reply to this email directly, view it on GitHub https://github.com/prashant-ramcharan/courgette-jvm/issues/335#issuecomment-1155607873, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWIEGE5XCHMUXJYYGLWFNVDVPDJNHANCNFSM5YRCZBBQ . You are receiving this because you authored the thread.Message ID: @.***>

prashant-ramcharan commented 2 years ago

Today, I commented the junit dependency in Maven sure fire plugin. This time it worked and the test reports (Courgette and master thought reports) got generated with failed feature files. Not sure if there is any issue with junit.

Most likely as I'm unable to reproduce this.