reportportal/agent-java-junit

Items doesn't finish in RP by reason of NPE in method stopOverAll()

pskvortsov opened this issue · 13 comments

Junit agent built from master branch

Stacktrace:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project rider-srv: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test failed: There was an error in the forked process [ERROR] org.apache.maven.surefire.testset.TestSetFailedException: java.lang.NullPointerException; nested exception is java.lang.NullPointerException: null [ERROR] java.lang.NullPointerException [ERROR] at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:210) [ERROR] at com.google.common.collect.Collections2$TransformedCollection.<init>(Collections2.java:256) [ERROR] at com.google.common.collect.Collections2.transform(Collections2.java:247) [ERROR] at com.epam.reportportal.junit.ParallelRunningHandler.stopOverAll(ParallelRunningHandler.java:386) [ERROR] at com.epam.reportportal.junit.ParallelRunningHandler.stopLaunch(ParallelRunningHandler.java:108) [ERROR] at com.epam.reportportal.junit.ReportPortalListener.testRunFinished(ReportPortalListener.java:99) [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.junit4.JUnit4Provider.invoke(JUnit4Provider.java:127) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

Hi, apparently I have encountered with the same issue as above. Could you please have a look on it?
Thank you, Zsolt

Stacktrace

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project integration-testing: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: There was an error in the forked process
[ERROR] org.apache.maven.surefire.testset.TestSetFailedException: java.lang.NullPointerException
[ERROR] at org.apache.maven.surefire.common.junit4.JUnit4RunListener.rethrowAnyTestMechanismFailures(JUnit4RunListener.java:213)
[ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:133)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR] Caused by: java.lang.NullPointerException
[ERROR] at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:210)
[ERROR] at com.google.common.collect.Collections2$TransformedCollection.<init>(Collections2.java:256)
[ERROR] at com.google.common.collect.Collections2.transform(Collections2.java:247)
[ERROR] at com.epam.reportportal.junit.ParallelRunningHandler.stopOverAll(ParallelRunningHandler.java:386)
[ERROR] at com.epam.reportportal.junit.ParallelRunningHandler.stopLaunch(ParallelRunningHandler.java:108)
[ERROR] at com.epam.reportportal.junit.ReportPortalListener.testRunFinished(ReportPortalListener.java:99)
[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.junit4.JUnit4Provider.invoke(JUnit4Provider.java:131)

@pictureb00k @avarabyeu ^

:'(

@pskvortsov Could you please check the fix before release (3ecbb00)? It may be accessed via jitpack:

<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>
	<dependency>
	    <groupId>com.github.reportportal</groupId>
	    <artifactId>agent-java-junit</artifactId>
	    <version>3ecbb00a14</version>
	</dependency>

@kovaku Hello, could you check this fix? I tried it, but I have another issue. In addition, @avarabyeu will be happy if you can give him an example of a project where it happened.

Hi, I used jitpack.io and agent-java-junit v.3ecbb00a14 and have such issue (see stack trace below).
Could you provide example-java-junit project? It is possible integrate serenity BDD project with RP?
Thanks. BR.

[ERROR] Exception in provider [ERROR] org.apache.maven.surefire.booter.SurefireExecutionException: Exception in provider [ERROR] at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:88) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1060) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:907) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:785) [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) [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:289) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [ERROR] at org.codehaus.classworlds.Launcher.main(Launcher.java:47) [ERROR] Caused by: com.google.inject.CreationException: Unable to create injector, see the following errors: [ERROR] [ERROR] 1) null returned by binding at com.epam.reportportal.guice.ReportPortalClientModule.configure(ReportPortalClientModule.java:62) [ERROR] but the 3rd parameter of com.epam.reportportal.guice.ReportPortalClientModule.provideReportPortalService(ReportPortalClientModule.java:166) is not @Nullable [ERROR] while locating java.lang.String annotated with @com.epam.reportportal.guice.ListenerPropertyValue(value=BATCH_SIZE_LOGS) [ERROR] for the 3rd parameter of com.epam.reportportal.guice.ReportPortalClientModule.provideReportPortalService(ReportPortalClientModule.java:166) [ERROR] at com.epam.reportportal.guice.ReportPortalClientModule.provideReportPortalService(ReportPortalClientModule.java:166) [ERROR] while locating com.epam.reportportal.service.BatchedReportPortalService [ERROR] for field at com.epam.reportportal.junit.JUnitProvider.reportPortalService(JUnitProvider.java:35) [ERROR] while locating com.epam.reportportal.junit.JUnitProvider [ERROR] at com.epam.reportportal.junit.JUnitListenersModule.configure(JUnitListenersModule.java:37) [ERROR] while locating com.epam.reportportal.junit.IListenerHandler [ERROR] [ERROR] 1 error [ERROR] at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470) [ERROR] at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184) [ERROR] at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110) [ERROR] at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:232) [ERROR] at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:236) [ERROR] at com.epam.reportportal.guice.BaseInjector.createChildInjector(BaseInjector.java:71) [ERROR] at com.epam.reportportal.guice.Injector.getChildInjector(Injector.java:68) [ERROR] at com.epam.reportportal.junit.JUnitInjectorProvider$1.get(JUnitInjectorProvider.java:40) [ERROR] at com.epam.reportportal.junit.JUnitInjectorProvider$1.get(JUnitInjectorProvider.java:37) [ERROR] at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:160) [ERROR] at com.epam.reportportal.junit.JUnitInjectorProvider.getInstance(JUnitInjectorProvider.java:45) [ERROR] at com.epam.reportportal.junit.ReportPortalListener.<init>(ReportPortalListener.java:42) [ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [ERROR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [ERROR] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [ERROR] at java.lang.Class.newInstance(Class.java:442) [ERROR] at org.apache.maven.surefire.util.ReflectionUtils.instantiate(ReflectionUtils.java:112) [ERROR] at org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory.createCustomListeners(JUnit4RunListenerFactory.java:45) [ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:137) [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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:202) [ERROR] at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:158) [ERROR] at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:81) [ERROR] at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:84)

@plumkins answered in slack. plz, move to separate issue if some problem appears with jbehave integration

can we close this issue?

We still have the case when launch doesn't finish always and there are no exceptions in a console.

I tried on ReportPortal 3 ( API Service: 3.3.2; Service Index: 3.1.1; Authorization Service: 3.3.0; Service UI: 3.3.2;) and ReportPortal 4 (Analysis Service: 4.1.0; API Service: 4.1.0; Index Service: 4.0.0; Jira Service: 4.1.0; Rally Service: 4.0.0; EPAM Authorization Service: 4.1.0; Service UI: 4.1.0).

My maven config:

  <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
   <dependency>
	  <groupId>com.epam.reportportal</groupId>
	  <artifactId>agent-java-junit</artifactId>
	  <version>2.7.0</version>
	</dependency>
	    <dependency>
      <groupId>com.epam.reportportal</groupId>
      <artifactId>logger-java-log4j</artifactId>
      <version>4.0.1</version>
    </dependency>
    <dependency>
	<groupId>log4j</groupId>
	<artifactId>log4j</artifactId>
	<version>1.2.17</version>
</dependency>		

<

    <plugins>
        <plugin>
		    <groupId>org.apache.maven.plugins</groupId>
		    <artifactId>maven-surefire-plugin</artifactId>
		    <version>2.21.0</version>
            <configuration>
				 <properties>
				     <property>
						 <name>listener</name>
						 <value>com.epam.reportportal.junit.ReportPortalListener</value>
				     </property>
				 </properties>
    		</configuration>
    		<executions>
		          <execution>
		            <phase>test</phase>
		          </execution>
	        </executions>
        </plugin>
    </plugins>
</build><

does it really related to stacktrace mention in issue description? or there is new one?

The result the same(on RP application side), but stacktrace is clean.
Do I need to open the new one?

I have tried to contact via slack regarding this exact issue. Its been 11 days since the @IevgenIevstafiev reported this and 5 days since I posted on slack. This is a critical issue for us. Opened new issue.

JUnit example: https://github.com/reportportal/example-java-junit
@johnypony3 your example project doesn't contain @RunWith annotation