diff --git a/TESTING.asciidoc b/TESTING.asciidoc index e9279c3c7ce41..3b0dcebcf0f63 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -43,6 +43,12 @@ supports a remote debugging option: ./gradlew run --debug-jvm --------------------------------------------------------------------------- +This will instruct all JVMs (including any that run cli tools such as creating the keyring or adding users) +to suspend and initiate a debug connection on port incrementing from 5005. +As such the IDE needs to be instructed to listen for connections on this port. +Since we might run multiple JVMs as part of configuring and starting the cluster it's +recommended to have the option to aut restart checked. + ==== Distribution By default a node is started with the zip distribution. diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/RunTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/RunTask.java index 1512e9f2cf73c..129c74df7276d 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/RunTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/RunTask.java @@ -36,7 +36,7 @@ public Boolean getDebug() { @Override public void beforeStart() { - int debugPort = 8000; + int debugPort = 5005; int httpPort = 9200; int transportPort = 9300; Map additionalSettings = System.getProperties().entrySet().stream() @@ -57,7 +57,7 @@ public void beforeStart() { "Running elasticsearch in debug mode, {} suspending until connected on debugPort {}", node, debugPort ); - node.jvmArgs("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=" + debugPort); + node.jvmArgs("-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=" + debugPort); debugPort += 1; } }