7174723: java/lang/ProcessBuilder/Basic.java failing [win] (original) (raw)

Alan Bateman Alan.Bateman at oracle.com
Thu Jun 7 14🔞45 UTC 2012


Mike,

ProcessBuilder/Basic.java has been failing on Windows since the hash work went into jdk8/tl. This test is 11500 tests in one and the removeMappings fix fixes some of the failures. I looked into remaining issues today and it's another assumption on iteration order. A child process prints out the map of its environment variables and the parent assumes the order that they come back. I've changed the test so that the child process sorts them and adjusted the order that the parent expects. This means the test is passing again on all platforms. Attached is the patch. Assuming you are okay with then then we can push it after you push the fix for 7174736.

-Alan

diff --git a/test/java/lang/ProcessBuilder/Basic.java b/test/java/lang/ProcessBuilder/Basic.java --- a/test/java/lang/ProcessBuilder/Basic.java +++ b/test/java/lang/ProcessBuilder/Basic.java @@ -248,6 +248,7 @@ public class Basic {

  private static String getenvAsString(Map<String,String> environment) {
      StringBuilder sb = new StringBuilder();

@@ -1625,7 +1626,7 @@ public class Basic { childArgs.add("System.getenv()"); String[] cmdp = childArgs.toArray(new String[childArgs.size()]); String[] envp;

"SystemRoot="+systemRoot};

"SystemRoot="+systemRoot}; String[] envpOth = {"=ExitValue=3", "=C:=\"}; if (Windows.is()) { envp = envpWin; @@ -1633,7 +1634,7 @@ public class Basic { envp = envpOth; } Process p = Runtime.getRuntime().exec(cmdp, envp);

"=C:=\,SystemRoot="+systemRoot+",=ExitValue=3," : "=C:=\,";

"=C:=\,=ExitValue=3,SystemRoot="+systemRoot+"," : "=C:=\,"; String commandOutput = commandOutput(p); if (MacOSX.is()) { commandOutput = removeMacExpectedVars(commandOutput); @@ -1690,7 +1691,7 @@ public class Basic { commandOutput = removeMacExpectedVars(commandOutput); } check(commandOutput.equals(Windows.is()



More information about the core-libs-dev mailing list