We are getting org.gradle.listener.ListenerNotificationException with gradle 1.3


(Gil Katz) #1

While running WebDriver tests using Jenkins, we are getting from time to time this exception.

org.gradle.listener.ListenerNotificationException: Failed to notify test result processor. at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:97) at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at $Proxy3.output(Unknown Source) at org.gradle.api.internal.tasks.testing.processors.CaptureTestOutputTestResultProcessor$StdOutForwarder.onOutput(CaptureTestOutputTestResultProcessor.java:90) at org.gradle.logging.internal.DefaultStandardOutputRedirector$WriteAction.execute(DefaultStandardOutputRedirector.java:83) at org.gradle.logging.internal.DefaultStandardOutputRedirector$WriteAction.execute(DefaultStandardOutputRedirector.java:79) at org.gradle.util.LineBufferingOutputStream.flush(LineBufferingOutputStream.java:109) at org.gradle.util.LineBufferingOutputStream.write(LineBufferingOutputStream.java:85) at java.io.OutputStream.write(OutputStream.java:99) at java.io.PrintStream.write(PrintStream.java:430) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202) at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272) at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:85) at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:168) at java.io.PrintStream.newLine(PrintStream.java:496) at java.io.PrintStream.println(PrintStream.java:757) at org.gradle.util.LinePerThreadBufferingOutputStream.println(LinePerThreadBufferingOutputStream.java:199) at com.kenshoo.automation.src.utils.StrUtils.generateStringSetFromMap(StrUtils.java:1168) at com.kenshoo.automation.src.ui.pages.elements.campaign.advancedSearch.util.AssertAdvancedSearchUtil.assertAdvSrcKeywordsGrid(AssertAdvancedSearchUtil.java:255) at com.kenshoo.automation.tests.advancedsearch.regressionadvancedsearch.search.TestKeywordsAdvancedSearch.testSearchKeywords(TestKeywordsAdvancedSearch.java:83) at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48) at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:55) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:42) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:75) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at $Proxy2.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.remote.internal.TypeCastDispatch.dispatch(TypeCastDispatch.java:30) at org.gradle.messaging.remote.internal.WorkerProtocol.handleIncoming(WorkerProtocol.java:53) at org.gradle.messaging.remote.internal.WorkerProtocol.handleIncoming(WorkerProtocol.java:31) at org.gradle.messaging.remote.internal.ProtocolStack$ProtocolStage.handleIncoming(ProtocolStack.java:167) at org.gradle.messaging.remote.internal.ProtocolStack$BottomStage.handleIncoming(ProtocolStack.java:277) at org.gradle.messaging.remote.internal.ProtocolStack$BottomConnection$1.run(ProtocolStack.java:299) at org.gradle.messaging.remote.internal.ProtocolStack$ExecuteRunnable.dispatch(ProtocolStack.java:120) at org.gradle.messaging.remote.internal.ProtocolStack$ExecuteRunnable.dispatch(ProtocolStack.java:116) at org.gradle.messaging.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:132) at org.gradle.messaging.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:33) at org.gradle.messaging.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:72) at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2882) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390) at java.lang.StringBuffer.append(StringBuffer.java:224) at org.gradle.api.internal.tasks.testing.junit.result.XmlTestSuite.addOutput(XmlTestSuite.java:148) at org.gradle.api.internal.tasks.testing.junit.JUnitXmlReportGenerator.output(JUnitXmlReportGenerator.java:40) at org.gradle.api.internal.tasks.testing.results.StateTrackingTestResultProcessor.output(StateTrackingTestResultProcessor.java:79) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:88) at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at $Proxy3.output(Unknown Source) at org.gradle.api.internal.tasks.testing.processors.CaptureTestOutputTestResultProcessor$StdOutForwarder.onOutput(CaptureTestOutputTestResultProcessor.java:90) at org.gradle.logging.internal.DefaultStandardOutputRedirector$WriteAction.execute(DefaultStandardOutputRedirector.java:83) at org.gradle.logging.internal.DefaultStandardOutputRedirector$WriteAction.execute(DefaultStandardOutputRedirector.java:79) at org.gradle.util.LineBufferingOutputStream.flush(LineBufferingOutputStream.java:109) at org.gradle.util.LineBufferingOutputStream.write(LineBufferingOutputStream.java:85) at java.io.OutputStream.write(OutputStream.java:99) at java.io.PrintStream.write(PrintStream.java:430) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202) at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272) at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:85) at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:168) at java.io.PrintStream.newLine(PrintStream.java:496) at java.io.PrintStream.println(PrintStream.java:757) at org.gradle.util.LinePerThreadBufferingOutputStream.println(LinePerThreadBufferingOutputStream.java:199) at com.kenshoo.automation.src.utils.StrUtils.generateStringSetFromMap(StrUtils.java:1168) at com.kenshoo.automation.src.ui.pages.elements.campaign.advancedSearch.util.AssertAdvancedSearchUtil.assertAdvSrcKeywordsGrid(AssertAdvancedSearchUtil.java:255) ============= com.kenshoo.automation.src.utils.AutomationTestCase$1.failed(AutomationTestCase.java:346)


(Peter Niederwieser) #2

The stack trace indicates that you are running out of memory. You’ll have to give more memory to the test JVM (or make the test log/print less information). See the DSL reference for the ‘Test’ task for how to do so.

PS: Please always wrap stack traces in HTML ‘code’ tags.


(Gil Katz) #3

I gave it -DGRADLE_OPTS=-Xms1024m -Xmx2048m -XX:MaxPermSize=256m It seems enough :frowning: I will check with more Thanks


(Peter Niederwieser) #4

You need to give the test JVM more memory, not the Gradle JVM. See the DSL reference for the Test task for how to do so.


(Gil Katz) #5

Thanks I will check it on tonight run


(Gil Katz) #6

BTW when setting jvmArgs ‘-Xmx2048m’, ‘-Xms1024m’, ‘-XX:MaxPermSize=256m’ I get the following error Could not find method allJvmArgs() for arguments [-Xmx2048m, -Xms1024m, -XX:MaxPermSize=256m] on root project

When I set jvmArgs ‘-Xmx2048m’, ‘-Xms1024m’, ‘-XX:MaxPermSize=256m’ Everything is OK According to your DSL to set jvm heap size we have to use jvmArgs and not jvmArgs

In the example you also give

//tweaking memory settings for the forked vm that runs tests

jvmArgs ‘-Xms128m’, ‘-Xmx512m’, ‘-XX:MaxPermSize=128m’


(Peter Niederwieser) #7

According to your DSL to set jvm heap size we have to use jvmArgs and not jvmArgs

Not sure what you mean by that.


(Gil Katz) #8

I mean that I get error while using allJvmArgs which according to the DSL is the right place to put Xmx and Xms


(Peter Niederwieser) #9

For heap, you should use ‘minHeapSize’ and ‘maxHeapSize’. For PermGen, you should use ‘jvmArgs’.


(Gil Katz) #10

Thanks that worked You should update your help