diff options
author | Harald Musum <musum@yahooinc.com> | 2023-01-06 10:32:13 +0100 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2023-01-06 10:32:13 +0100 |
commit | 666e6472b450e8980367745d33274e55b34fdc2e (patch) | |
tree | 52c7cb7e9597764af9ec017f13b11f6b621a4fda /node-repository/src/test/java | |
parent | 0e626cd6b838e9949a3145202541662882457079 (diff) |
Stop using shared hosts mincount from flag when provisioning
Diffstat (limited to 'node-repository/src/test/java')
-rw-r--r-- | node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainerTest.java | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainerTest.java index 28530ddd39a..27a944a471e 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainerTest.java @@ -22,7 +22,6 @@ import com.yahoo.net.HostName; import com.yahoo.vespa.flags.InMemoryFlagSource; import com.yahoo.vespa.flags.PermanentFlags; import com.yahoo.vespa.flags.custom.ClusterCapacity; -import com.yahoo.vespa.flags.custom.SharedHost; import com.yahoo.vespa.hosted.provision.Node; import com.yahoo.vespa.hosted.provision.NodeList; import com.yahoo.vespa.hosted.provision.NodeRepository; @@ -76,7 +75,6 @@ public class HostCapacityMaintainerTest { tester.maintain(); assertTrue(tester.nodeRepository.nodes().node("host2").isEmpty()); - assertTrue(tester.nodeRepository.nodes().node("host3").isEmpty()); } @Test @@ -208,50 +206,6 @@ public class HostCapacityMaintainerTest { } @Test - public void verify_min_count_of_shared_hosts() { - // What's going on here? We are trying to verify the impact of varying the minimum number of - // shared hosts (SharedHost.minCount()). - // - // addInitialNodes() adds 4 tenant hosts: - // host1 shared !removable # not removable because it got child nodes w/allocation - // host2 !shared removable # not counted as a shared host because it is failed - // host3 shared removable - // host4 shared !removable # not removable because it got child nodes w/allocation - // - // Hosts 1, 3, and 4 count as "shared hosts" with respect to the minCount lower boundary. - // Hosts 3 and 4 are removable, that is they will be deprovisioned as excess hosts unless - // prevented by minCount. - - // minCount=0: All (2) removable hosts are deprovisioned - assertWithMinCount(0, 0, 2); - // minCount=1: The same thing happens, because there are 2 shared hosts left - assertWithMinCount(1, 0, 2); - assertWithMinCount(2, 0, 2); - // minCount=3: since we require 3 shared hosts, host3 is not deprovisioned. - assertWithMinCount(3, 0, 1); - // 4 shared hosts require we provision 1 shared host - assertWithMinCount(4, 1, 1); - // 5 shared hosts require we provision 2 shared hosts - assertWithMinCount(5, 2, 1); - assertWithMinCount(6, 3, 1); - } - - private void assertWithMinCount(int minCount, int provisionCount, int deprovisionCount) { - var tester = new DynamicProvisioningTester().addInitialNodes(); - tester.hostProvisioner.overrideHostFlavor("host4"); - - tester.flagSource.withJacksonFlag(PermanentFlags.SHARED_HOST.id(), new SharedHost(null, minCount), SharedHost.class); - tester.maintain(); - assertEquals(provisionCount, tester.hostProvisioner.provisionedHosts().size()); - assertEquals(deprovisionCount, tester.hostProvisioner.deprovisionedHosts()); - - // Verify next maintain is a no-op - tester.maintain(); - assertEquals(provisionCount, tester.hostProvisioner.provisionedHosts().size()); - assertEquals(deprovisionCount, tester.hostProvisioner.deprovisionedHosts()); - } - - @Test public void does_not_remove_if_host_provisioner_failed() { var tester = new DynamicProvisioningTester(); Node host2 = tester.addNode("host2", Optional.empty(), NodeType.host, Node.State.failed, DynamicProvisioningTester.tenantApp); |