JDK-8283279 : [Testbug] Improve TestGetSwapSpaceSize
  • Type: Bug
  • Component: core-svc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2022-03-16
  • Updated: 2024-06-04
  • Resolved: 2022-03-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 19
17.0.4Fixed 19 b16Fixed
Related Reports
Relates :  
Description
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.
Comments
Fix Request (OpenJDK 17u): Please approve backporting this test-only fix to 17u. The test might spuriously pass earlier if pre-condition isn't met. This is now asserted. Should be low risk as it is a test-only change. Container tests continue to pass.
06-04-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk17u-dev/pull/339 Date: 2022-04-06 12:53:57 +0000
06-04-2022

Changeset: a7716006 Author: Severin Gehwolf <sgehwolf@openjdk.org> Date: 2022-03-23 15:00:05 +0000 URL: https://git.openjdk.java.net/jdk/commit/a77160065bb6f62314711514f7694fe50f0dc35b
23-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7854 Date: 2022-03-17 13:40:53 +0000
17-03-2022