# HG changeset patch # User aoqi # Date 1548950197 -28800 # Node ID 71aba4a921a01d1b9673d8d8aa6f28346cbe5f35 # Parent 35d9d8c13d30f1bca900f8d97b28a79cecec6601 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 diff -r 35d9d8c13d30 -r 71aba4a921a0 test/runtime/containers/docker/TestCPUAwareness.java --- a/test/runtime/containers/docker/TestCPUAwareness.java Tue Mar 19 17:30:58 2019 +0100 +++ b/test/runtime/containers/docker/TestCPUAwareness.java Thu Jan 31 23:56:37 2019 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,7 +125,8 @@ private static void testCpus(int valueToSet, int expectedTraceValue) throws Exception { Common.logNewTestCase("test cpus: " + valueToSet); DockerRunOptions opts = Common.newOpts(imageName) - .addDockerOpts("--cpus", "" + valueToSet); + .addDockerOpts("--cpu-period=" + 10000) + .addDockerOpts("--cpu-quota=" + valueToSet * 10000); Common.run(opts) .shouldMatch("active_processor_count.*" + expectedTraceValue); }