# HG changeset patch # User amenkov # Date 1573682884 28800 # Node ID 439a147b2c0ca47afc2ffbbdb4b898a619ca1e64 # Parent 5f458adec06b379b9121efd7b32c878a45ced188 8231915: two JDI tests interfere with each other Reviewed-by: sspitsyn, dtitov diff -r 5f458adec06b -r 439a147b2c0c test/jdk/com/sun/jdi/JdwpListenTest.java --- a/test/jdk/com/sun/jdi/JdwpListenTest.java Wed Nov 13 13:05:16 2019 -0800 +++ b/test/jdk/com/sun/jdi/JdwpListenTest.java Wed Nov 13 14:08:04 2019 -0800 @@ -54,6 +54,10 @@ private static final boolean IsWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + // Set to true to allow testing of attach from wrong address (expected to fail). + // It's off by default as it causes test time increase and test interference (see JDK-8231915). + private static boolean allowNegativeTesting = false; + public static void main(String[] args) throws Exception { List addresses = getAddresses(); @@ -87,6 +91,11 @@ throws IOException { log("\nTest: listen at " + listenAddress + ", attaching from " + connectAddress + ", expected: " + (expectedResult ? "SUCCESS" : "FAILURE")); + if (!expectedResult && !allowNegativeTesting) { + log("SKIPPED: negative testing is disabled"); + return; + } + log("Starting listening debuggee at " + listenAddress); try (Debuggee debuggee = Debuggee.launcher("HelloWorld").setAddress(listenAddress + ":0").launch()) { log("Debuggee is listening on " + listenAddress + ":" + debuggee.getAddress()); @@ -103,6 +112,7 @@ } } } + log("PASSED"); } private static void addAddr(List list, InetAddress addr) {