Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8222533

jtreg test jdk/internal/platform/cgroup/TestCgroupMetrics.java fails on SLES12.3 linux ppc64le machine

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b21
    • CPU:
      generic
    • OS:
      linux

      Backports

        Description

        Currently the jtreg test

        jdk/internal/platform/cgroup/TestCgroupMetrics.java

        fails on my linux ppc64le test machine (SLES 12.3) . (jdk/jdk hg)
        It gives me :

        java.lang.RuntimeException: Test failed for - blkio:blkio.throttle.io_service_bytes - Total, expected [25288465162240], got [158457046589440]
                        at jdk.test.lib.containers.cgroup.MetricsTester.fail(MetricsTester.java:188)
                        at jdk.test.lib.containers.cgroup.MetricsTester.testBlkIO(MetricsTester.java:515)
                        at TestCgroupMetrics.main(TestCgroupMetrics.java:51)
                        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
                        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
                        at java.base/java.lang.Thread.run(Thread.java:835)

        The failure happens here, when a metrics value is compared with a value read from file system (oldVal/newVal).
        MetricsTester.java :

            public void testBlkIO() {
                Metrics metrics = Metrics.systemMetrics();
                    long oldVal = metrics.getBlkIOServiceCount();
                long newVal = getLongValueFromFile(SubSystem.BLKIO,
                        "blkio.throttle.io_service_bytes", "Total");
                if (!compareWithErrorMargin(oldVal, newVal)) {
                    fail(SubSystem.BLKIO, "blkio.throttle.io_service_bytes - Total",
                            oldVal, newVal);
                }

        It seems the wrong values from /sys/fs/cgroup/blkio/blkio.throttle.io_service_bytes are compared :

        fgrep Total /sys/fs/cgroup/blkio/blkio.throttle.io_service_bytes
        254:6 Total 25350186577920
           ...
        Total 158652998460416

        Once the first value is taken , and once the last (where the line ***starts*** with Total).
        Short analysis from B.Vandette found that

        open/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/SubSystem.java:151
        in getLongEntry, seems to do the following :

        "Instead of finding the first line that starts with “Total”, it finds the first line that contains “Total”. "

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                bobv Bob Vandette (Inactive)
                Reporter:
                mbaesken Matthias Baesken
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: