Unable to deal with Gradle Test Executor 1. failed to execute tests

2020-04-15 06:29:16,357 unitTesting INFO Running gradle test
2020-04-15 06:29:51,076 unitTesting INFO Gradle test complete!
2020-04-15 06:29:51,078 unitTesting INFO
Gradle test logs:
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/5.2.1/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing

Task :compileJava
Task :processResources
Task :classes
Task :compileTestJava
Task :processTestResources NO-SOURCE
Task :testClasses

Task :test

com.crio.qcharm.ds.SourceFileHandlerArrayListImplTest > efficientSearchReplace() STANDARD_OUT
0

com.crio.qcharm.ds.SourceFileHandlerArrayListImplTest > efficientSearchReplace() STANDARD_ERROR
Apr 15, 2020 6:29:49 AM org.junit.platform.launcher.core.DefaultLauncher handleThrowable
WARNING: TestEngine with ID ‘junit-jupiter’ failed to execute tests
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3664)
at java.lang.String.(String.java:207)
at java.lang.StringBuilder.toString(StringBuilder.java:407)
at org.apache.commons.lang3.StringUtils.replace(StringUtils.java:5526)
at org.apache.commons.lang3.StringUtils.replace(StringUtils.java:5464)
at org.apache.commons.lang3.StringUtils.replace(StringUtils.java:5404)
at com.crio.qcharm.ds.SourceFileVersionArrayListImpl.apply(SourceFileVersionArrayListImpl.java:278)
at com.crio.qcharm.ds.SourceFileHandlerArrayListImpl.searchReplace(SourceFileHandlerArrayListImpl.java:258)
at com.crio.qcharm.ds.SourceFileHandlerArrayListImplTest.efficientSearchReplace(SourceFileHandlerArrayListImplTest.java:820)
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.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:675)
at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:125)
at org.junit.jupiter.engine.extension.TimeoutInvocation.proceed(TimeoutInvocation.java:46)
at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:132)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:124)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:74)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$107/519981089.apply(Unknown Source)
at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall$$Lambda$108/1410358567.apply(Unknown Source)
at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
at org.junit.jupiter.engine.execution.ExecutableInvoker$$Lambda$221/2099614073.apply(Unknown Source)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:104)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:62)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:43)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:35)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:202)

TEST RESULT: FAILURE
TEST SUMMARY: RAN 1 TESTS, 0 SUCCEEDED, 0 FAILED, 1 SKIPPED

Task :test FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:test’.

There were failing tests. See the report at: file:///tmp/external_build/reports/tests/test/index.html

  • 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 33s
4 actionable tasks: 4 executed

2020-04-15 06:29:51,078 unitTesting INFO Gradle test run complete
2020-04-15 06:29:51,078 unitTesting INFO Build failed


Please check the above FAQ. Let me know if it was helpful or not.

I have gone through the FAQ but still I can’t figure out a solution for the problem. I am iterating over the cursors and then using string replace to make a new list. The local build is passing every time.

This issue happens is because if there is a Memory Leakage or Unnecessary looping. You will to see what is the cause and decode it.

Closing this topic as it has been solved by you yourself. Great job, keep working hard. if its not resolved feel free to un-mark the accepted solution to re-open the topic.