JDK-8242480 introduced a test for verifying that swap space size doesn't become negative. The premise is that if --memory and --memory-swap are set to the same value (i.e. no swap), the OperatingSystemMXBean should not return negative values.
However the test might spuriously pass if, for some reason, the host values get returned by the OperatingSystemMXBean. Since the test always runs in a container environment this should not happen and the test should fail.
The test needs to get improved to fail if some strange swap sizes are being returned. E.g. --memory X --memory-swap X, but OperatingSystemMXBean.getTotalSwapSpaceSize > 0.