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

Igor Ignatyev igor.ignatyev at oracle.com
Thu Nov 28 16:36:10 UTC 2019


Hi Christoph,

both your suggestions sound good to me.

-- Igor

> On Nov 28, 2019, at 12:55 AM, Langer, Christoph <christoph.langer at sap.com> wrote:
> 
> Hi Matthias,
>  
> First of all, thanks for tackling this issue which pops up with MacOS 10.15.
>  
> In the test, however, I think we should not/don’t need to query for the explicit MacOS version. Just do the writability check and if it fails, throw the SkippedException.
>  
> As for the message text, I’d prefer: “Directory \“” + coresDir +”\” is not writable”. I think that’s both, explicit and concise. @Igor, what do you think?
>  
> And there’s one last thing what I was thinking about: Is it really necessary that /cores is writable for the user? Maybe the system can still write a core into /cores? I’m trying to verify this now on my Catalina MacBook… will let you know.
>  
> Cheers
> Christoph
>  
> From: Baesken, Matthias <matthias.baesken at sap.com> 
> Sent: Donnerstag, 28. November 2019 09:33
> To: Igor Ignatyev <igor.ignatyev at oracle.com>
> Cc: hotspot-dev at openjdk.java.net; Langer, Christoph <christoph.langer at sap.com>
> Subject: RE: RFR: [XS] 8234625: hs test serviceability/sa/ClhsdbCDSCore.java fails on macOS 10.15
>  
> so I'd suggest to change it to something like '/cores is not writable'.
> Hi  Igor, done :
>  
> http://cr.openjdk.java.net/~mbaesken/webrevs/8234625.2/ <http://cr.openjdk.java.net/~mbaesken/webrevs/8234625.2/>
>  
>  
> May I add you as reviewer now ?
>  
> Best regards, Matthias
>  
>  
> From: Igor Ignatyev <igor.ignatyev at oracle.com <mailto:igor.ignatyev at oracle.com>> 
> Sent: Mittwoch, 27. November 2019 19:15
> 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>; Langer, Christoph <christoph.langer at sap.com <mailto:christoph.langer at sap.com>>
> Subject: Re: RFR: [XS] 8234625: hs test serviceability/sa/ClhsdbCDSCore.java fails on macOS 10.15
>  
> SkippedException's message is used by jtreg as a reason why a test was skipped, so I'd suggest to change it to something like '/cores is not writable'.
>  
> I'm also not sure if we really need to check version string at L#123 now, but it's fine if you decide to keep it.
>  
>  
> Thanks.
> -- Igor
>  
> 
> On Nov 27, 2019, at 6:30 AM, Baesken, Matthias <matthias.baesken at sap.com <mailto:matthias.baesken at sap.com>> wrote:
>  
> Ø  I'd recommend you to use jtreg.SkippedException to signal that the test can't be run or to introduce new @requires property
>  
>  
> Hello, I  now  changed  the test  to throw a  SkippedException  :
>  
> http://cr.openjdk.java.net/~mbaesken/webrevs/8234625.1/ <http://cr.openjdk.java.net/~mbaesken/webrevs/8234625.1/>
>  
>  
> Best regards, Matthias
>  
>  
> From: Igor Ignatyev <igor.ignatyev at oracle.com <mailto:igor.ignatyev at oracle.com>> 
> Sent: Dienstag, 26. November 2019 18:35
> 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
>  
> 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 <mailto: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