RFR: [XS] 8234625: hs test serviceability/sa/ClhsdbCDSCore.java fails on macOS 10.15

Igor Ignatyev igor.ignatyev at oracle.com
Tue Nov 26 17:34:58 UTC 2019


for now, we have only test/jtreg-ext/requires/VMProps.java which sets @requires properties; although 'env.core.accessible' and similar properties aren't vm-related properties per-se so VMProps isn't the best place to set them. however VMProps already sets a few non vm properties, and given introduction of another class to set these properties is a bit of hassle, I think it's fine to just add `env.core.accessible` to VMProps (and later rename VMProps to be more appropriate for all kinds of properties).

there is one thing which you should be aware than add any new requires properties, jtreg runs VMProps once for *every* execution even if none of "target" tests use @requires, in other words, all test executions pay price of setting all properties, therefore it should be costly.

-- Igor

> On Nov 26, 2019, at 2:07 AM, Baesken, Matthias <matthias.baesken at sap.com> wrote:
> 
>  
> or to introduce new @requires property, say `env.core.accessible`, which is true iif core dumping is enabled and dumped cores can be accessed from the test code.
>  
> Hello Igor,  that sounds interesting.
>  
> Who would set the say env.core.accessible property  accordingly (so that in our environment on 10.15 it would be false) ?
>  
> Best regards, Matthias
>  
>  
> From: Igor Ignatyev <igor.ignatyev at oracle.com <mailto:igor.ignatyev at oracle.com>> 
> Sent: Montag, 25. November 2019 21:10
> To: Baesken, Matthias <matthias.baesken at sap.com <mailto:matthias.baesken at sap.com>>
> Cc: hotspot-dev at openjdk.java.net <mailto:hotspot-dev at openjdk.java.net>
> Subject: Re: RFR: [XS] 8234625: hs test serviceability/sa/ClhsdbCDSCore.java fails on macOS 10.15
>  
> Hi Matthias,
>  
> your solution will hide the fact that the coverage from this test will be missed on macos 10.15+. I'd recommend you to use jtreg.SkippedException to signal that the test can't be run or to introduce new @requires property, say `env.core.accessible`, which is true iif core dumping is enabled and dumped cores can be accessed from the test code.
>  
> -- Igor
> 
> 
> On Nov 25, 2019, at 1:58 AM, Baesken, Matthias <matthias.baesken at sap.com <mailto:matthias.baesken at sap.com>> wrote:
>  
> Hello,   the test
> serviceability/sa/ClhsdbCDSCore.java
> fails on macOS 10.15 .
> exception :
> java.lang.Error: cores is not a directory or does not have write permissions
>                 at ClhsdbCDSCore.main(ClhsdbCDSCore.java:115)
>                 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>                 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>                 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>                 at java.base/java.lang.reflect.Method.invoke(Method.java:564)
>                 at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
>                 at java.base/java.lang.Thread.run(Thread.java:833)
> 
> Looks like the test checks that directory /cores is writable :
> File coresDir = new File("/cores");
> if (!coresDir.isDirectory() || !coresDir.canWrite()) { ... // fail
> However on macOS 10.15 /cores is not writable any more (at least for most users, including our test user).
> So the test fails.
>  
> My change adjusts the test, so that it gives a clearer error message,  and  returns gracefully in case  we are running on macOS 10.15 and notice a non-writeable /cures directory .
>  
>  
>  
> Bug/webrev :
>  
> https://bugs.openjdk.java.net/browse/JDK-8234625 <https://bugs.openjdk.java.net/browse/JDK-8234625>
>  
> http://cr.openjdk.java.net/~mbaesken/webrevs/8234625.0/ <http://cr.openjdk.java.net/~mbaesken/webrevs/8234625.0/>
>  
>  
> Best regards, Matthias



More information about the hotspot-dev mailing list