summaryrefslogtreecommitdiffstats
path: root/node-repository
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2020-01-13 16:16:19 +0100
committerMartin Polden <mpolden@mpolden.no>2020-01-13 16:17:32 +0100
commite22bb6f5ca207e897dcde8a65416f46f2a039583 (patch)
tree4a6b7fbf095a853e71fc7fd3bee354f9952049fc /node-repository
parent4e2478aabcd2ed3945ac0294cefd2cf325e39bbf (diff)
Revert "Remove unnecessary content/combined substitution"
This reverts commit 0e3637dfdd8c7301cefe986c889971efad1f3781. Removed too early. Need to wait until old config models disappear.
Diffstat (limited to 'node-repository')
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java
index 8fde8cae399..f2c9c409fdb 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java
@@ -651,6 +651,35 @@ public class ProvisioningTest {
tester.activate(application, state.allHosts);
}
+ @Test
+ public void change_to_combined_cluster_does_not_change_node_allocation() {
+ var tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).build();
+ var application = tester.makeApplicationId();
+
+ tester.makeReadyNodes(4, defaultResources);
+
+ // Application allocates two content nodes initially. This is the old behaviour where combined clusters has type
+ // content
+ ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.content,
+ ClusterSpec.Id.from("combined"),
+ Version.fromString("1.2.3"),
+ false);
+ var initialNodes = tester.activate(application, tester.prepare(application, cluster,
+ Capacity.fromCount(2, defaultResources, false, false),
+ 1));
+
+ // Application is redeployed with cluster type combined
+ cluster = ClusterSpec.request(ClusterSpec.Type.combined,
+ ClusterSpec.Id.from("combined"),
+ Version.fromString("1.2.3"),
+ false);
+ var newNodes = tester.activate(application, tester.prepare(application, cluster,
+ Capacity.fromCount(2, defaultResources, false, false),
+ 1));
+
+ assertEquals("Node allocation remains the same", initialNodes, newNodes);
+ }
+
private SystemState prepare(ApplicationId application, int container0Size, int container1Size, int content0Size,
int content1Size, NodeResources flavor, ProvisioningTester tester) {
return prepare(application, container0Size, container1Size, content0Size, content1Size, flavor,