On Thu, 11 Aug 2022 21:12:08 GMT, Bill Huang <d...@openjdk.org> wrote:

> This task converts 2 shell tests to java version. 
> test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh 
> test/java/lang/management/RuntimeMXBean/TestInputArgument.sh

test/jdk/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java 
line 59:

> 57:     // The system load average may be changing due to other jobs running.
> 58:     // Allow some delta.
> 59:     private static double DELTA = 0.05;

Not a part of your fix but could you make it final?

test/jdk/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java 
line 69:

> 67:     }
> 68: 
> 69:     @Test(invocationCount = 5, timeOut = 300)

I am not sure it is the correct replacement. Accordingly to TestNG doc the 
invocationCount = 5 means that TestNG calls the test 5 times.  And test fails 
if any of the invocations fail while the bash script makes 5 attempts and 
passes if testcase passed in any of them.

test/jdk/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java 
line 71:

> 69:     @Test(invocationCount = 5, timeOut = 300)
> 70:     void testSystemLoadAvg() throws Exception {
> 71:         if (!OS.contains("Win")) {

Check /test/lib/jdk/test/lib/Platform.java, it contains "Platform.isWindows()" 
which could be used for this.

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

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

Reply via email to