zebrunner / reporting

Zebrunner Reporting Tool
https://zebrunner.com/documentation
Apache License 2.0
210 stars 43 forks source link

handle NPE exception for zc.getTestRunResults() call #1649

Closed vdelendik closed 5 years ago

vdelendik commented 5 years ago

From time to time we receive NPE on below line. The most common way when Zafira is overloaded (mass queue registration is in progress).

ZafiraListener.java:171 List testRunResults = Arrays.asList(zc.getTestRunResults(run.getId()).getObject());

According to my understanding 171-181 lines are needed to recalculate test based on need_rerun flag. I'd recommend to skip those steps if test run is in QUEUED status at all. For queued all tests. Or put 171-181 line inside if (ZAFIRA_RERUN_FAILURES) { operator

12:31:20 [com.qaprosoft.zafira.listener.ZafiraListener] ERROR - Undefined error during test run registration! 12:31:20 java.lang.NullPointerException: null 12:31:20 at com.qaprosoft.zafira.listener.ZafiraListener.onStart(ZafiraListener.java:171) ~[zafira-client-4.0.57.jar:na] 12:31:20 at org.testng.SuiteRunner.invokeListeners(SuiteRunner.java:301) [testng-6.14.3.jar:na] 12:31:20 at org.testng.SuiteRunner.run(SuiteRunner.java:362) [testng-6.14.3.jar:na] 12:31:20 at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) [testng-6.14.3.jar:na] 12:31:20 at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84) [testng-6.14.3.jar:na] 12:31:20 at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208) [testng-6.14.3.jar:na] 12:31:20 at org.testng.TestNG.runSuitesLocally(TestNG.java:1137) [testng-6.14.3.jar:na] 12:31:20 at org.testng.TestNG.runSuites(TestNG.java:1049) [testng-6.14.3.jar:na] 12:31:20 at org.testng.TestNG.run(TestNG.java:1017) [testng-6.14.3.jar:na] 12:31:20 at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:283) [surefire-testng-2.22.1.jar:2.22.1] 12:31:20 at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75) [surefire-testng-2.22.1.jar:2.22.1] 12:31:20 at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120) [surefire-testng-2.22.1.jar:2.22.1] 12:31:20 at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384) [surefire-booter-2.22.1.jar:2.22.1] 12:31:20 at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345) [surefire-booter-2.22.1.jar:2.22.1] 12:31:20 at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126) [surefire-booter-2.22.1.jar:2.22.1] 12:31:20 at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418) [surefire-booter-2.22.1.jar:2.22.1]

hursevich commented 5 years ago

Fixed.