8217597: [TESTBUG] old version docker does not support --cpus

Thu, 31 Jan 2019 23:56:37 +0800

author
aoqi
date
Thu, 31 Jan 2019 23:56:37 +0800
changeset 9657
71aba4a921a0
parent 9656
35d9d8c13d30
child 9658
fc5ffcba674b

8217597: [TESTBUG] old version docker does not support --cpus
Summary: "--cpus" is only available in Docker 1.13 and higher, and is the equivalent of setting both --cpu-period and --cpu-quota.
Reviewed-by: bobv, dholmes
Contributed-by: aoqi@loongson.cn

test/runtime/containers/docker/TestCPUAwareness.java file | annotate | diff | comparison | revisions
     1.1 --- a/test/runtime/containers/docker/TestCPUAwareness.java	Tue Mar 19 17:30:58 2019 +0100
     1.2 +++ b/test/runtime/containers/docker/TestCPUAwareness.java	Thu Jan 31 23:56:37 2019 +0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -125,7 +125,8 @@
    1.11      private static void testCpus(int valueToSet, int expectedTraceValue) throws Exception {
    1.12          Common.logNewTestCase("test cpus: " + valueToSet);
    1.13          DockerRunOptions opts = Common.newOpts(imageName)
    1.14 -            .addDockerOpts("--cpus", "" + valueToSet);
    1.15 +            .addDockerOpts("--cpu-period=" + 10000)
    1.16 +            .addDockerOpts("--cpu-quota=" + valueToSet * 10000);
    1.17          Common.run(opts)
    1.18              .shouldMatch("active_processor_count.*" + expectedTraceValue);
    1.19      }

mercurial