You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently use QAF 3.0.0 with Gradle 7.0.2. [ but i have tested this issue on 3.1.0b, 3.0.0 & gradle 4.x ,5.x, 6.4.2, 7.0.2, 7.2] I have started to notice that when I fail out a test with Reporter.log("fail", MessageTypes.Fail); . I get a Null Pointer Exception from gradle and it fails the gradle build. However if I fail the test through TestNG (Assert.assertTrue(false);). I do not get the null pointer exception and the build is successful.
The null pointer does not happen when all tests pass.
QAF Version
3.1.0b
3.0.0
Steps To Reproduce
Create a test method and fail using Reporter.log(..)
[see test case example section]
Run the automation through gradle >gradlew clean test
Expected behavior
Gradle Build is successful and indicates failures Gradle Console
[QAFSuiteListener] - onFinish: done
Test: Test suite 'Suite' produced standard out/err: [QAFSuiteListener] - onFinish: done
[QAFSuiteListener] - onFinish: done
Preparing For Shut Down...
Result updator: Completed 1 Remaining 0 result to be update.
ElasticSearcch connection closed successfully
1 test completed, 1 failed
There were failing tests. See the report at: file:/// {workspace&project path} /build/reports/tests/test/index.html
BUILD SUCCESSFUL in 31s
3 actionable tasks: 3 executed
Actual behavior
Two null pointers are generated and the gradle build failed. Gradle Console
[QAFSuiteListener] - onFinish: done
Test: Gradle Test Executor 3 produced standard out/err: [QAFSuiteListener] - onFinish: done
[QAFSuiteListener] - onFinish: done
Preparing For Shut Down...
Result updator: Completed 1 Remaining 0 result to be update.
ElasticSearcch connection closed successfully
1 test completed, 1 failed
> Task :test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> Failed to notify test listener.
> java.lang.NullPointerException (no error message)
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 37s
3 actionable tasks: 3 executed
Is the issue reproducible on runner?
QAS
Maven
Gradle
Ant
Eclipse
More Details
This is not happening in Maven because, i believe, maven did not create a test report after a run unless a plugin is used. The Qmetry report is still generated successfully but gradle reports a build failure.
It seems like it needs to be a valid failure using the Reporter or QAF framework failure. If the test throws exceptions that doesn’t count as a failure by the framework but is counted by TestNG (from my understanding). Any failures handled by TestNG have no issues reporting back to gradle properly.
It is as if there is a test listener that nulls out the test objects when it is done with it. So when the gradle listener tries to listen at the end for the test results so that it can report on the results with it's own reports the values it is looking for are null.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> Failed to notify test listener.
> java.lang.NullPointerException (no error message)
> java.lang.NullPointerException (no error message)
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':test'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:187)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:268)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:395)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify test listener.
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:89)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
at com.sun.proxy.$Proxy70.afterTest(Unknown Source)
at org.gradle.api.internal.tasks.testing.results.TestListenerAdapter.completed(TestListenerAdapter.java:50)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:245)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:157)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
at com.sun.proxy.$Proxy72.completed(Unknown Source)
at org.gradle.api.internal.tasks.testing.results.StateTrackingTestResultProcessor.completed(StateTrackingTestResultProcessor.java:96)
at org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor.completed(AttachParentTestResultProcessor.java:56)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.FailureHandlingDispatch.dispatch(FailureHandlingDispatch.java:30)
at org.gradle.internal.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:87)
at org.gradle.internal.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:36)
at org.gradle.internal.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:71)
at org.gradle.internal.concurrent.InterruptibleRunnable.run(InterruptibleRunnable.java:42)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Cause 1: java.lang.NullPointerException
at org.gradle.api.internal.tasks.testing.logging.FullExceptionFormatter.printException(FullExceptionFormatter.java:55)
at org.gradle.api.internal.tasks.testing.logging.FullExceptionFormatter.format(FullExceptionFormatter.java:44)
at org.gradle.api.internal.tasks.testing.logging.TestEventLogger.after(TestEventLogger.java:83)
at org.gradle.api.internal.tasks.testing.logging.TestEventLogger.afterTest(TestEventLogger.java:59)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:245)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:157)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
at com.sun.proxy.$Proxy70.afterTest(Unknown Source)
at org.gradle.api.internal.tasks.testing.results.TestListenerAdapter.completed(TestListenerAdapter.java:50)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:245)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:157)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
at com.sun.proxy.$Proxy72.completed(Unknown Source)
at org.gradle.api.internal.tasks.testing.results.StateTrackingTestResultProcessor.completed(StateTrackingTestResultProcessor.java:96)
at org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor.completed(AttachParentTestResultProcessor.java:56)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.FailureHandlingDispatch.dispatch(FailureHandlingDispatch.java:30)
at org.gradle.internal.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:87)
at org.gradle.internal.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:36)
at org.gradle.internal.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:71)
at org.gradle.internal.concurrent.InterruptibleRunnable.run(InterruptibleRunnable.java:42)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Cause 2: java.lang.NullPointerException
at org.gradle.api.internal.tasks.testing.junit.result.TestReportDataCollector.exceptionClassName(TestReportDataCollector.java:113)
at org.gradle.api.internal.tasks.testing.junit.result.TestReportDataCollector.failureMessage(TestReportDataCollector.java:106)
at org.gradle.api.internal.tasks.testing.junit.result.TestReportDataCollector.afterTest(TestReportDataCollector.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:245)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:157)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
at com.sun.proxy.$Proxy70.afterTest(Unknown Source)
at org.gradle.api.internal.tasks.testing.results.TestListenerAdapter.completed(TestListenerAdapter.java:50)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:245)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:157)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
at com.sun.proxy.$Proxy72.completed(Unknown Source)
at org.gradle.api.internal.tasks.testing.results.StateTrackingTestResultProcessor.completed(StateTrackingTestResultProcessor.java:96)
at org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor.completed(AttachParentTestResultProcessor.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.FailureHandlingDispatch.dispatch(FailureHandlingDispatch.java:30)
at org.gradle.internal.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:87)
at org.gradle.internal.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:36)
at org.gradle.internal.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:71)
at org.gradle.internal.concurrent.InterruptibleRunnable.run(InterruptibleRunnable.java:42)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.lang.Thread.run(Thread.java:748)
* Get more help at https://help.gradle.org
BUILD FAILED in 15s
2 actionable tasks: 2 executed
gradlew clean test --debug Gradle Debug Dump
2021-12-08T13:19:29.433-0700 [DEBUG] [TestEventLogger]
2021-12-08T13:19:29.434-0700 [DEBUG] [TestEventLogger] Suite FAILED
2021-12-08T13:19:29.748-0700 [LIFECYCLE] [org.gradle.api.internal.tasks.testing.worker.TestWorker]
2021-12-08T13:19:29.748-0700 [INFO] [org.gradle.api.internal.tasks.testing.worker.TestWorker] Gradle Test Executor 20 finished executing tests.
2021-12-08T13:19:29.749-0700 [DEBUG] [org.gradle.process.internal.worker.child.ActionExecutionWorker] Completed Gradle Test Executor 20.
2021-12-08T13:19:29.335-0700 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
2021-12-08T13:19:29.335-0700 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :test
2021-12-08T13:19:29.750-0700 [DEBUG] [TestEventLogger]
2021-12-08T13:19:29.751-0700 [DEBUG] [TestEventLogger] Gradle Test Executor 20 FAILED
2021-12-08T13:19:29.789-0700 [QUIET] [system.out] Preparing For Shut Down...
2021-12-08T13:19:31.645-0700 [LIFECYCLE] [org.gradle.cache.internal.DefaultFileLockManager]
2021-12-08T13:19:31.645-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2021-12-08T13:19:31.645-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-12-08T13:19:31.646-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2021-12-08T13:19:31.650-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2021-12-08T13:19:31.651-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-12-08T13:19:31.652-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2021-12-08T13:19:35.618-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Execute executeTests for :test'
2021-12-08T13:19:35.619-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Executing task ':test''
2021-12-08T13:19:35.619-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Snapshot outputs after executing task ':test'' started
2021-12-08T13:19:31.433-0700 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
2021-12-08T13:19:31.433-0700 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :test
2021-12-08T13:19:35.607-0700 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: SUCCEEDED
2021-12-08T13:19:35.607-0700 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'Gradle Test Executor 20' finished with exit value 0 (state: SUCCEEDED)
2021-12-08T13:19:35.610-0700 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.2.23 completed (1 worker(s) in use)
2021-12-08T13:19:35.610-0700 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Dispatch org.gradle.api.internal.tasks.testing.processors.RestartEveryNTestClassProcessor@4a67e368: released lock on root.1.2.23
2021-12-08T13:19:35.612-0700 [DEBUG] [TestEventLogger]
2021-12-08T13:19:35.612-0700 [DEBUG] [TestEventLogger] Gradle Test Run :test FAILED
2021-12-08T13:19:35.613-0700 [ERROR] [org.gradle.api.internal.tasks.testing.logging.TestCountLogger]
1 test completed, 1 failed
2021-12-08T13:19:35.618-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Execute executeTests for :test' completed
2021-12-08T13:19:35.619-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Executing task ':test'' completed
2021-12-08T13:19:35.742-0700 [LIFECYCLE] [org.gradle.internal.operations.DefaultBuildOperationRunner]
2021-12-08T13:19:35.742-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Snapshot outputs after executing task ':test''
2021-12-08T13:19:35.635-0700 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
2021-12-08T13:19:35.635-0700 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :test FAILED
2021-12-08T13:19:35.743-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Snapshot outputs after executing task ':test'' completed
2021-12-08T13:19:35.744-0700 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Removed task artifact state for task ':test' from context.
2021-12-08T13:19:35.745-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Task :test'
2021-12-08T13:19:35.745-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Task :test' completed
2021-12-08T13:19:35.745-0700 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :test (Thread[Daemon worker Thread 15,5,main]) completed. Took 24.693 secs.
2021-12-08T13:19:35.746-0700 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :test failed
2021-12-08T13:19:35.746-0700 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :test completed, executed: true
2021-12-08T13:19:35.747-0700 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 15: released lock on :
2021-12-08T13:19:35.747-0700 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.2 completed (1 worker(s) in use)
2021-12-08T13:19:35.747-0700 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 15: released lock on root.1.2
2021-12-08T13:19:35.748-0700 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 3,5,main]] finished, busy: 0.0 secs, idle: 28.33 secs
2021-12-08T13:19:35.748-0700 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Daemon worker Thread 15,5,main]] finished, busy: 24.977 secs, idle: 3.355 secs
2021-12-08T13:19:35.748-0700 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':',5,main]] finished, busy: 0.0 secs, idle: 28.33 secs
2021-12-08T13:19:35.748-0700 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 2,5,main]] finished, busy: 3.297 secs, idle: 25.034 secs
2021-12-08T13:19:35.750-0700 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskExecutionGraph] Timing: Executing the DAG took 28.336 secs
2021-12-08T13:19:35.751-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Run tasks'
2021-12-08T13:19:35.751-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Run tasks' completed
2021-12-08T13:19:35.755-0700 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1 completed (0 worker(s) in use)
2021-12-08T13:19:35.756-0700 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 15: released lock on root.1
2021-12-08T13:19:35.757-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-12-08T13:19:35.757-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2021-12-08T13:19:35.757-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-12-08T13:19:35.757-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2021-12-08T13:19:35.758-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':test'.
2021-12-08T13:19:35.758-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to notify test listener.
2021-12-08T13:19:35.758-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.lang.NullPointerException (no error message)
2021-12-08T13:19:35.759-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.lang.NullPointerException (no error message)
2021-12-08T13:19:35.759-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-12-08T13:19:35.760-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2021-12-08T13:19:35.760-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
2021-12-08T13:19:35.761-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-12-08T13:19:35.761-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
2021-12-08T13:19:35.761-0700 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
2021-12-08T13:19:35.762-0700 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 33s
2021-12-08T13:19:35.762-0700 [LIFECYCLE] [org.gradle.internal.buildevents.TaskExecutionStatisticsReporter] 3 actionable tasks: 3 executed
The text was updated successfully, but these errors were encountered:
This is because gradle internal listener assumes exception on test failure. The efficient implementation should taken care of null values :). In case of verification falilure(s) there will not any exception and still the test status will be failed.
To deal with it you can check if there is a way to disable gradle reporting. As alternate work around you can add testng listener to add exception in failed test's test result object. For example:
public class TestListener implements ITestListener {
@Override
public void onTestFailure(ITestResult result) {
if(result.getThrowable()==null ){
result.setThrowable(new AssertionError("One or more verification failed"));
}
}
}
Overview
I currently use QAF 3.0.0 with Gradle 7.0.2. [ but i have tested this issue on 3.1.0b, 3.0.0 & gradle 4.x ,5.x, 6.4.2, 7.0.2, 7.2] I have started to notice that when I fail out a test with
Reporter.log("fail", MessageTypes.Fail);
. I get a Null Pointer Exception from gradle and it fails the gradle build. However if I fail the test through TestNG (Assert.assertTrue(false);
). I do not get the null pointer exception and the build is successful.The null pointer does not happen when all tests pass.
QAF Version
Steps To Reproduce
[see test case example section]
>gradlew clean test
Expected behavior
Gradle Build is successful and indicates failures
Gradle Console
Actual behavior
Two null pointers are generated and the gradle build failed.
Gradle Console
Is the issue reproducible on runner?
More Details
This is not happening in Maven because, i believe, maven did not create a test report after a run unless a plugin is used. The Qmetry report is still generated successfully but gradle reports a build failure.
It seems like it needs to be a valid failure using the Reporter or QAF framework failure. If the test throws exceptions that doesn’t count as a failure by the framework but is counted by TestNG (from my understanding). Any failures handled by TestNG have no issues reporting back to gradle properly.
It is as if there is a test listener that nulls out the test objects when it is done with it. So when the gradle listener tries to listen at the end for the test results so that it can report on the results with it's own reports the values it is looking for are null.
Test case sample
build.gradle
dependencies { implementation 'com.qmetry:qaf:3.0.0' }
Test Class
Gradle Debug Output
gradlew clean test --stacktrace
Stacktrace Dump
gradlew clean test --debug
Gradle Debug Dump
The text was updated successfully, but these errors were encountered: