Different uptime output format on mac os x (test/java/lang/management/OperatingSystemMXBean/GetSys)

XMLWordPrintable

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: P3
    • None
    • Affects Version/s: 7
    • Component/s: other-libs
    • generic
    • os_x

      On mac os x, output of uptime command is different.

      Next fix helped test to pass:
      $ hg diff test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java
      diff -r d4a63859633c test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java
      --- a/test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java Wed Jun 15 11:49:10 2011 -0700
      +++ b/test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java Mon Jul 04 02:55:08 2011 -0700
      @@ -79,7 +79,7 @@
               System.out.println("Test passed.");
           }
       
      - private static String LOAD_AVERAGE_TEXT = "load average:";
      + private static String LOAD_AVERAGE_TEXT = "load averages:";
           private static void checkLoadAvg() throws Exception {
               // Obtain load average from OS command
               ProcessBuilder pb = new ProcessBuilder("/usr/bin/uptime");
      @@ -95,7 +95,7 @@
               System.out.println("Load average returned from uptime = " + output);
               System.out.println("getSystemLoadAverage() returned " + loadavg);
       
      - String[] lavg = output.split(",");
      + String[] lavg = output.trim().split(" ");
               double expected = Double.parseDouble(lavg[0]);
               double lowRange = expected * (1 - DELTA);
               double highRange = expected * (1 + DELTA);

            Assignee:
            Unassigned
            Reporter:
            Aleksandre Iline
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: