diff options
3 files changed, 10 insertions, 3 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index 24721cafbe9..c64bc99d0c7 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -554,6 +554,11 @@ public class InternalStepRunner implements StepRunner { static byte[] servicesXml(SystemName systemName, Optional<String> testerFlavor) { String domain = systemName == SystemName.main ? "vespa.vespa" : "vespa.vespa.cd"; + String flavor = testerFlavor.orElse("d-1-4-50"); + int memoryGb = Integer.parseInt(flavor.split("-")[2]); // Memory available in tester container. + int jdiscMemoryPercentage = (int) Math.ceil(200.0 / memoryGb); // 2Gb memory for tester application (excessive?). + int testMemoryMb = 768 * (memoryGb - 2); // Memory allocated to Surefire running tests. ≥25% left for other stuff. + String servicesXml = "<?xml version='1.0' encoding='UTF-8'?>\n" + "<services xmlns:deploy='vespa' version='1.0'>\n" + @@ -562,6 +567,7 @@ public class InternalStepRunner implements StepRunner { " <component id=\"com.yahoo.vespa.hosted.testrunner.TestRunner\" bundle=\"vespa-testrunner-components\">\n" + " <config name=\"com.yahoo.vespa.hosted.testrunner.test-runner\">\n" + " <artifactsPath>artifacts</artifactsPath>\n" + + " <surefireMemoryMb>" + testMemoryMb + "</surefireMemoryMb>\n" + " </config>\n" + " </component>\n" + "\n" + @@ -594,7 +600,7 @@ public class InternalStepRunner implements StepRunner { " </filtering>\n" + " </http>\n" + "\n" + - " <nodes count=\"1\" flavor=\"" + testerFlavor.orElse("d-1-4-50") + "\" />\n" + + " <nodes count=\"1\" flavor=\"" + flavor + "\" allocated-memory=\"" + jdiscMemoryPercentage + "%\" />\n" + " </container>\n" + "</services>\n"; diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java index f941e2ba7ca..a6755a96fdd 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java @@ -292,7 +292,7 @@ public class InternalStepRunnerTest { @Test public void generates_correct_services_xml_test() { - assertFile("test_runner_services.xml-cd", new String(InternalStepRunner.servicesXml(SystemName.cd, Optional.of("flavor")))); + assertFile("test_runner_services.xml-cd", new String(InternalStepRunner.servicesXml(SystemName.cd, Optional.of("d-2-12-75")))); } private void assertFile(String resourceName, String actualContent) { diff --git a/controller-server/src/test/resources/test_runner_services.xml-cd b/controller-server/src/test/resources/test_runner_services.xml-cd index b395d657e3d..15d3c98b995 100644 --- a/controller-server/src/test/resources/test_runner_services.xml-cd +++ b/controller-server/src/test/resources/test_runner_services.xml-cd @@ -5,6 +5,7 @@ <component id="com.yahoo.vespa.hosted.testrunner.TestRunner" bundle="vespa-testrunner-components"> <config name="com.yahoo.vespa.hosted.testrunner.test-runner"> <artifactsPath>artifacts</artifactsPath> + <surefireMemoryMb>7680</surefireMemoryMb> </config> </component> @@ -37,6 +38,6 @@ </filtering> </http> - <nodes count="1" flavor="flavor" /> + <nodes count="1" flavor="d-2-12-75" allocated-memory="17%" /> </container> </services> |