[jdk8u-dev] RFR: 8295164: JDK 8 jdi tests should not use tasklist command on Windows [v2]
zzambers
duke at openjdk.org
Wed Oct 12 21:39:17 UTC 2022
On Wed, 12 Oct 2022 18:54:17 GMT, zzambers <duke at openjdk.org> wrote:
>> Shell jdi tests are currently failing on windows. These tests are part of jdk_tier1.
>>
>> **Problem:**
>> Tests fail because ShellScaffold.sh uses (native) tasklist command to check if process with given PID is alive. However this no longer works, since PIDs by Cygwin/Msys2 are no longer same as native Windows PIDs [1][2].
>>
>> **Solution:**
>> Fixed by switching to ps command. Original comment says tasklist was used due to ps sometimes missing some processes. This could be because ps, by default, only shows cygwin processes. I added -W argument to also show native windows processes [3] and I have seen no problems. Fix is targeted for JDK8, since newer JDKs migrated to java based tests (in several steps [4][5][6][7]...), but i think backporting all of that work, just to fix this issue would be overkill. (However nothing prevents anyone from doing so in the future, if desired.)
>>
>> **Testing:**
>> With this fix jdk_tier1 passes for me on Windows.
>>
>> [1] https://github.com/msys2/MSYS2-packages/issues/1724
>> [2] https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=b5e1003722cb14235c4f166be72c09acdffc62ea
>> [3] https://www.cygwin.com/cygwin-ug-net/ps.html
>> [4] https://bugs.openjdk.org/browse/JDK-8209109
>> [5] https://bugs.openjdk.org/browse/JDK-8209604
>> [6] https://bugs.openjdk.org/browse/JDK-8210243
>> [7] https://bugs.openjdk.org/browse/JDK-8210760
>
> zzambers has updated the pull request incrementally with one additional commit since the last revision:
>
> Enable jdk_tier1 testing on Windows in GHA
Interesting, one test failed on Windows x64. I have not seen this failure before (when testing this change).
TEST: com/sun/jdi/DoubleAgentTest.java
java.lang.Exception: Debuggee does not have ERROR in the output: EError occurred during initialization of VM
agent library failed to initRROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
: jdwp
at DoubleAgentTest.main(DoubleAgentTest.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
at java.lang.Thread.run(Thread.java:750)
JavaTest Message: Test threw exception: java.lang.Exception
JavaTest Message: shutting down test
It is failure of jdi test, but not shell one, and it does not seem related to bug being fixed by this PR. Looks like output got interleaved as result of race condition. Actually this is most probably result of bad design of that particular test, where stdout and stderr are being concurrently collected into single string field named "outputText" [1]. Seems like word "ERROR" got split by text from the other stream, resulting in test failure [2]. Bad luck that "ERROR" word get split :) , but test should definitely be fixed (I'll look at that later).
[1] https://github.com/openjdk/jdk8u-dev/blob/861ac32e43a425b682d18a2cc748a8b82435148f/jdk/test/com/sun/jdi/DoubleAgentTest.java#L78
[2] https://github.com/openjdk/jdk8u-dev/blob/861ac32e43a425b682d18a2cc748a8b82435148f/jdk/test/com/sun/jdi/DoubleAgentTest.java#L145
-------------
PR: https://git.openjdk.org/jdk8u-dev/pull/133
More information about the jdk8u-dev
mailing list