[jdk8u-dev] RFR: 8297141: Fix hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java for 8u
zzambers
duke at openjdk.org
Wed Nov 16 14:02:48 UTC 2022
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
-------------
Commit messages:
- Fix hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java
Changes: https://git.openjdk.org/jdk8u-dev/pull/181/files
Webrev: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=181&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8297141
Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk8u-dev/pull/181.diff
Fetch: git fetch https://git.openjdk.org/jdk8u-dev pull/181/head:pull/181
PR: https://git.openjdk.org/jdk8u-dev/pull/181
More information about the jdk8u-dev
mailing list