I am trying to debug my Spock test in Gradle in IntelliJ with ctrl+shift+d (in other words: context menu -> debug).
But unfortunately it fails with following output:
Testing started at 12:13 ...
12:13:42: Executing external tasks 'cleanTest test --tests "com.***.MyTest.test1"
:cleanTest
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:compileTestJava UP-TO-DATE
:compileTestGroovy UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test
Connected to the target VM, address: '127.0.0.1:60991', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:60991', transport: 'socket'
ERROR: transport error 202: connect failed: Connection refused
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]
Process 'Gradle Test Executor 3' finished with non-zero exit value 134
org.gradle.process.internal.ExecException: Process 'Gradle Test Executor 3' finished with non-zero exit value 134
What is interesting, simple run of test is passing. I am starting it on Mac, IntelliJ 15.