Repository: incubator-geode Updated Branches: refs/heads/develop ea8aabbcc -> 204024264
GEODE-466 add ability to set debug port for dunit VMs - DUnits launched with -Ddunit.debug.basePort=<port value> will use the given value as the initial debug port for the first VM and incremented by 1 for each additional VM. - DUnits launched with -Ddunit.debug.suspendVM=<vm id> will use the given value to determine which VM is launched in debug suspended mode. Thus -2 (or -1) will suspend the locator and 0-3 would suspend one of the 4 default VMs. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/20402426 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/20402426 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/20402426 Branch: refs/heads/develop Commit: 2040242641535b362cc025079d027a7b74665a2f Parents: ea8aabb Author: Jens Deppe <[email protected]> Authored: Wed Oct 21 13:34:18 2015 -0700 Committer: Jens Deppe <[email protected]> Committed: Wed Oct 21 13:34:18 2015 -0700 ---------------------------------------------------------------------- .../src/test/java/dunit/standalone/ProcessManager.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20402426/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java b/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java index 1e993fb..c4a55ed 100644 --- a/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java +++ b/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java @@ -53,6 +53,8 @@ public class ProcessManager { private File log4jConfig; private int pendingVMs; private Registry registry; + private int debugPort = Integer.getInteger("dunit.debug.basePort", 0); + private int suspendVM = Integer.getInteger("dunit.debug.suspendVM", -100); public ProcessManager(int namingPort, Registry registry) { this.namingPort = namingPort; @@ -150,6 +152,15 @@ public class ProcessManager { String classPath = System.getProperty("java.class.path"); //String tmpDir = System.getProperty("java.io.tmpdir"); String agent = getAgentString(); + + String jdkDebug = ""; + if (debugPort > 0) { + jdkDebug += ",address=" + debugPort; + debugPort++; + } + + String jdkSuspend = vmNum == suspendVM ? "y" : "n"; + return new String[] { cmd, "-classpath", classPath, "-D" + DUnitLauncher.RMI_PORT_PARAM + "=" + namingPort, @@ -157,7 +168,7 @@ public class ProcessManager { "-D" + DUnitLauncher.WORKSPACE_DIR_PARAM + "=" + new File(".").getAbsolutePath(), "-DlogLevel=" + DUnitLauncher.LOG_LEVEL, "-Djava.library.path=" + System.getProperty("java.library.path"), - "-Xrunjdwp:transport=dt_socket,server=y,suspend=n", + "-Xrunjdwp:transport=dt_socket,server=y,suspend=" + jdkSuspend + jdkDebug, "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx512m", "-XX:MaxPermSize=256M",
