RFR: 8273805: gc/g1/TestGCLogMessages.java test should handle non-JFR configs

Aleksey Shipilev shade at openjdk.java.net
Wed Sep 15 10:53:27 UTC 2021


JDK-8273147 introduced a more thorough GC messages test, which includes JFR. But it is not guaranteed that JFR is actually in the build, like in the case of Zero:


$ CONF=linux-x86_64-zero-fastdebug make exploded-test TEST=gc/g1/TestGCLogMessages.java

java.lang.RuntimeException: '[debug.*Weak JFR Old Object Samples' missing from stdout/stderr

at jdk.test.lib.process.OutputAnalyzer.shouldMatch(OutputAnalyzer.java:340)
at gc.g1.TestGCLogMessages.checkMessagesAtLevel(TestGCLogMessages.java:193)
at gc.g1.TestGCLogMessages.testNormalLogs(TestGCLogMessages.java:224)
at gc.g1.TestGCLogMessages.main(TestGCLogMessages.java:199)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
at java.base/java.lang.Thread.run(Thread.java:833) 


Luckily, the test already uses `WhiteBox`, so we can just ask if JFR is in the build or not.

Additional testing:
 - [x] Linux x86_64 Zero, affected test now passes
 - [x] Linux x86_64 Server, affected test still passes
 - [x]  Linux x86_64 Server, verified the JFR test path is taken

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

Commit messages:
 - Fix

Changes: https://git.openjdk.java.net/jdk/pull/5529/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5529&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8273805
  Stats: 12 lines in 1 file changed: 11 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5529.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5529/head:pull/5529

PR: https://git.openjdk.java.net/jdk/pull/5529



More information about the hotspot-gc-dev mailing list