RFR 8085919: OperatingSystemMXBean/TestTotalSwap.java failure : Total Swap Space figures mismatch
Daniel D. Daugherty
daniel.daugherty at oracle.com
Wed Aug 5 14:00:23 UTC 2015
On 8/4/15 1:22 AM, Jaroslav Bachorik wrote:
> On 4.8.2015 09:13, David Holmes wrote:
>> On 4/08/2015 5:10 PM, Jaroslav Bachorik wrote:
>>> Hi David,
>>>
>>> On 4.8.2015 02:25, David Holmes wrote:
>>>> On 4/08/2015 1:31 AM, Jaroslav Bachorik wrote:
>>>>> Please, review the following test change
>>>>>
>>>>> Issue : https://bugs.openjdk.java.net/browse/JDK-8085919
>>>>> Webrev: http://cr.openjdk.java.net/~jbachorik/8085919/webrev.00
>>>>>
>>>>> The test fails on embedded machines with 'yocto' flavour of OS
>>>>> installed. For some reason the 'free -b' command ignores the
>>>>> request to
>>>>> report sizes in bytes and does report in kilobytes.
>>>>>
>>>>> I've changed the test to expect this behaviour (when the OS version
>>>>> string contains 'yocto') and in case the expected and reported total
>>>>> swap size are different to try conversion from kilobytes to bytes and
>>>>> check again.
>>>>
>>>> Seems okay. I would have tweaked this:
>>>>
>>>> long expected_swap_size = getSwapSizeFromOs();
>>>>
>>>> to
>>>>
>>>> long expected_swap_size = getSwapSizeFromOs() * (SwapInKB ?
>>>> 1024
>>>> : 1);
>>>
>>> I thought about this - but doing just this the test would start failing
>>> the minute they fix the 'free' tool in yocto linux distribution :/
>>
>> So instead we will carry a workaround for ever because we won't realize
>> it isn't needed anymore :)
>
> Um, well. Something like that. Can't really think of a good solution
> to this.
So here is the theory:
- We have a specific set of platforms for JDK9 and we make these
types of accommodations for bugs in those platforms.
- When we move on to JDK10, we will have a (hopefully) newer set
of platforms and we'll make new accommodations for bugs in those
platforms. We'll also remove accommodations for bugs that have
been fixed, but this is more rare.
If we don't know that a platform bug has been fixed because the
test still passes, we won't know to remove the accommodation in
JDK10. I like to see comments like this with such code:
// Work around for XYZ bug in 'yocto' version of Linux.
// When this platform bug is fixed, this test will fail
// again and we'll know that this work around can be removed.
So the result will be that JDK9 will have the work around in it
and that's fine because the broken platform is supported in that
release. JDK10 will not have the work around in it because the
broken platform is no longer supported in that release. If someone
tries to run the JDK10 version of the test on the 'yocto' platform
it will fail and, when investigated, the triage engineer will
hopefully realize that JDK10 should not be run on 'yocto'.
Dan
>
> -JB-
>
>>
>> Okay.
>>
>> Thanks,
>> David
>>
>>
>>> -JB-
>>>
>>>>
>>>> Cheers,
>>>> David
>>>>
>>>>> Thanks,
>>>>>
>>>>> -JB-
>>>
>
>
More information about the serviceability-dev
mailing list