RFR: 8288599: com/sun/management/OperatingSystemMXBean/TestTotalSwap.java: Expected total swap size ... but getTotalSwapSpaceSize returned ...

Kevin Walls kevinw at openjdk.org
Fri Jun 17 11:53:52 UTC 2022


On Thu, 16 Jun 2022 00:23:27 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

> The failure is very intermittent and I wasn't able to reproduce it.
> 
> I suspect that the swap might be changed during test execution so I add the corresponding check. 
> 
> If test still fails after fix we should at least exclude this potential problem.

Marked as reviewed by kevinw (Committer).

test/jdk/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java line 76:

> 74: 
> 75:         // if swap data from OS chnaged re-read OS and MBean data
> 76:         while (expected_swap_size != getSwapSizeFromOs()) {

Can we put a limit on this?
OS swap usage could be continually changing, this seems worth a try but we want to escape and give up after some number of tries?
If there is some variation that's making us fail, we could also mask off some number of low bits, or a byte or more even, to do an approximate comparison?  Might want to try that if retrying does not succeed.

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

PR: https://git.openjdk.org/jdk/pull/9174


More information about the serviceability-dev mailing list