Gradle test execution fails for tests that start a embedded ldap server

I have a bunch of spring security tests that start an embedded ldap server (apache ds instance) . These tests runs fine when run through -Dtest.single option where i put their package names. They run just fine if run from eclipse. If i remove the creation of embedded ldap server bit and provide a url to an external ldap server they run just fine. The problem, however , is if i do a gradle clean build where all tests are run , the test execution hangs when it reaches these tests , at which point i have to kill the process. Running the tests with --info or --debug didn’t help much in terms of providing helpful info . In debug mode i could see the much of the log messages that were logging of passing of messages come to a sudden halt. How to get rid of this situation , also i tried setting JAVA_OPTS for a higher heap size before running gradle build and these were taken by the main process , the worker thread that was executing the tests didn’t get any of those , is there a way for specifying java opts for the test worker thread process as well ?

Following are my gradle version details :-

------------------------------------------------------------ Gradle 1.0-rc-3 ------------------------------------------------------------

Gradle build time: Sunday, April 29, 2012 11:51:52 PM UTC Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.2 compiled on December 20 2010 Ivy: 2.2.0 JVM: 1.6.0_32 (Sun Microsystems Inc. 20.7-b02) OS: Windows 7 6.1 amd64

See the DSL reference for the Test task for how to manage memory settings for tests.