RFR: 8353489: Increase timeout and improve Windows compatibility in test/jdk/java/lang/ProcessBuilder/Basic.java [v2]

Oleksii Sylichenko duke at openjdk.org
Sat May 3 11:46:03 UTC 2025


On Fri, 2 May 2025 22:04:15 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> On the other hand, the test can be modified as follows: on Windows, pass an empty string as an argument to `echo` and expect two double quotes followed by a newline character as the valid result:
>> 
>> 
>> String[] cmdp = Windows.is() ? new String[]{"cmd.exe", "/c", "echo", ""} : new String[]{"echo"};
>> String[] envp = {"Hello", "World"}; // Yuck!
>> Process p = Runtime.getRuntime().exec(cmdp, envp);
>> String expected = Windows.is() ? """\n" : "\n";
>> equal(commandOutput(p), expected);
>> 
>> 
>> What do you prefer: the "echo/" variant or the "double quotes" variant?
>
> I'd use the 'echo/' version to keep the test simpler.

done: 61ab85f2cff6d35ba53f7538dcbca95e46d541cd

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23933#discussion_r2072379429


More information about the core-libs-dev mailing list