[jdk8u-dev] RFR: 8297141: Fix hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java for 8u [v2]

zzambers duke at openjdk.org
Mon Nov 21 17:40:43 UTC 2022


On Mon, 21 Nov 2022 17:32:04 GMT, zzambers <duke at openjdk.org> wrote:

>> Following test (from hotspot/tier1) currently fails on Windows x86:
>> `hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java`
>> 
>> **Test output:**
>> 
>> ...
>>  stdout: [];
>>  stderr: [openjdk version "1.8.0_362-internal"
>> OpenJDK Runtime Environment (build 1.8.0_362-internal-zzambers-54a485c13e59fa68ea9dc088f320520eedbe33fe-b00)
>> OpenJDK Server VM (build 25.362-b00, mixed mode)
>> ]
>>  exitValue = 0
>> 
>> java.lang.RuntimeException: 'UseSharedSpaces:' missing from stdout/stderr 
>> 
>> 	at com.oracle.java.testlibrary.OutputAnalyzer.shouldContain(OutputAnalyzer.java:134)
>> 	at DefaultUseWithClient.main(DefaultUseWithClient.java:68)
>> 	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)
>> ...
>> 
>> 
>> **Problem:**
>> Test is Windows 32-bit only, only applies to Client VM and checks default behaviour of shared archive feature. Problem is, that default build of 32-bit windows JDK does not include Client VM, so Server VM is used (so -client arg does nothing). With Server VM tests fails. I tried to make build which has Client VM and then this test passes (It breaks other tests which expect default to be Server VM though).
>> 
>> **Fix:**
>> Test runs java with `-version` argument, which can print something similar to:
>> 
>> openjdk version "1.8.0_362-internal"
>> OpenJDK Runtime Environment (build 1.8.0_362-internal-zzambers-2bbffac3199782df1f9b81867fdfeb3d72889fcd-b00)
>> OpenJDK Client VM (build 25.362-b00, mixed mode)
>> 
>> This output can be used to check if Client VM and skip other checks, if Client VM is not used. Fix is JDK 8 only as test has been removed on newer JDKs by JDK-8154204 by [2]. But I decided to fix it for JDK 8.
>> 
>> **Testing:**
>> With this change test passes on Windows 32-bit. (both with Server [3] and Client [4] Vms)
>> 
>> [1] https://github.com/zzambers/jdk8u-dev/actions/runs/3438556844
>> [2] https://bugs.openjdk.org/browse/JDK-8154204
>> [3] https://github.com/zzambers/jdk8u-dev/actions/runs/3462926725
>> [4] https://github.com/zzambers/jdk8u-dev/actions/runs/3462887672
>
> zzambers has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Changed detection of client VM

Updated detection code. Tested on both default build [5] (without Client VM) and build with Client VM [6] with windows-x86 testing enabled. Passed both.

[5] https://github.com/zzambers/jdk8u-dev/actions/runs/3482764139
[6] https://github.com/zzambers/jdk8u-dev/actions/runs/3483679375

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

PR: https://git.openjdk.org/jdk8u-dev/pull/181


More information about the jdk8u-dev mailing list