summaryrefslogtreecommitdiffstats
path: root/config-model/src/test
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2022-01-13 13:22:27 +0100
committerHarald Musum <musum@yahooinc.com>2022-01-13 13:22:27 +0100
commit381d5a1b55872b34b54d90aa0b83644e1000be45 (patch)
tree8a9247c626c381dee4db14f66fff4900abd6dddd /config-model/src/test
parentbfa87fbb5d684aed0d975e939e4d1fabb62bf00d (diff)
Give a more helpful warning when using invalid or misplaced JVM options
Diffstat (limited to 'config-model/src/test')
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java
index a17459ea800..814b2f94e44 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java
@@ -181,7 +181,7 @@ public class JvmOptionsTest extends ContainerModelBuilderTestBase {
"-XX:+ParallelGCThreads=8 foo bar");
fail();
} catch (IllegalArgumentException e) {
- assertTrue(e.getMessage().contains("Invalid JVM GC options in services.xml: bar,foo"));
+ assertTrue(e.getMessage().startsWith("Invalid or misplaced JVM GC options in services.xml: bar,foo"));
}
}
@@ -205,8 +205,10 @@ public class JvmOptionsTest extends ContainerModelBuilderTestBase {
assertEquals(Level.WARNING, firstOption.getFirst());
Collections.sort(strings);
- assertEquals("Invalid JVM " + (optionName.equals("gc-options") ? "GC " : "") +
- "options in services.xml: " + String.join(",", strings), firstOption.getSecond());
+ assertEquals("Invalid or misplaced JVM" + (optionName.equals("gc-options") ? " GC" : "") +
+ " options in services.xml: " + String.join(",", strings) + "." +
+ " See https://docs.vespa.ai/en/reference/services-container.html#jvm"
+ , firstOption.getSecond());
}
private void buildModelWithJvmOptions(boolean isHosted, TestLogger logger, String optionName, String override) throws IOException, SAXException {
@@ -267,7 +269,7 @@ public class JvmOptionsTest extends ContainerModelBuilderTestBase {
"-Xms2G foo bar");
fail();
} catch (IllegalArgumentException e) {
- assertTrue(e.getMessage().contains("Invalid JVM options in services.xml: bar,foo"));
+ assertTrue(e.getMessage().contains("Invalid or misplaced JVM options in services.xml: bar,foo"));
}
}