Increase Timeout and Improve Windows Compatibility in Basic.java Test #23933
+5
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Warning
Hi, I’ve created this pull request, but I don’t have the necessary permissions to create an issue for it. Could someone please create an issue to track this change? I’m not sure who to contact directly, so any help would be appreciated.
Thank you!
This PR proposes three improvements to the Basic.java test:
Increase Timeout
Fix Incompatibility with Windows (Cygwin vs. Native)
echo
command.cmd /c echo.
, which produces the same output (a single newline) in Windows, ensuring compatibility.Prevent Autorun Scripts in the
cmd /c set
Commandcmd /c set
, but in Windows, this may trigger autorun scripts./d
options to prevent autorun scripts from affecting the test results.These changes improve test reliability and ensure compatibility across different environments.
Testing:
cmd /c echo.
produces the expected output in Windows.cmd /d /c set
correctly lists environment variables without executing autorun scripts.Detailed Description
echo
The following test fails in a clean Windows environment (e.g., when run from IntelliJ IDEA without Cygwin):
with following error:
cmd.exe /c set
The following test fails in a Windows environment under specific conditions:
with following error:
Reason
In my environment, Miniconda was installed, which adds a script execution to the autorun of
cmd
. This script sets additional environment variables that break this test.To reproduce this bug, you can manually add a custom script to the autorun. I have described the steps in detail in my article: AutoRun for Windows Command Processor (cmd.exe).
Changes
For Windows
/d
towinEnvCommand
- to disable the execution of AutoRun commandsecho
withcmd /c echo.
Progress
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23933/head:pull/23933
$ git checkout pull/23933
Update a local copy of the PR:
$ git checkout pull/23933
$ git pull https://git.openjdk.org/jdk.git pull/23933/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23933
View PR using the GUI difftool:
$ git pr show -t 23933
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23933.diff