Running UT in gradle 3.1 raise OOM exception

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Running UT in gradle 3.1 raise OOM exception

Sharuru Z
Hello, I am using Spock framework with about 1500 unit test cases in the project.

Once I run the whole test in Eclipse, it works well.
But if I running it in gradle 3.1 using: gradle project:test, after about 300 cases, it will raise java.lang.IllegalStateException > Caused by: org.springframework.beans.factory.BeanDefinitionStoreException > Caused by: java.lang.OutOfMemoryError

I am tring to enlarge memory by using  --maxHeapSize or test.forkEvery, but the problem still appear.

My project is a Spring-boot project, using H2 in unit test, create-drop in each test class.

Is there anything I missed?

Thankyou!

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running UT in gradle 3.1 raise OOM exception

Sharuru Z
I solved my problem using the following config:

test {

  forkEvery = 100
  maxParallelForks = 2
  minHeapSize = "1024m"
  maxHeapSize = "4096m"
}


--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Loading...