summaryrefslogtreecommitdiffstats
path: root/orchestrator/src/test
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@yahooinc.com>2021-09-20 14:45:16 +0200
committerHåkon Hallingstad <hakon@yahooinc.com>2021-09-20 14:45:16 +0200
commit070a2249baefffc4ffa116728c6094f84148302e (patch)
tree39f4d6a6e090ab42cb9dad143180e6a35de6927c /orchestrator/src/test
parent23a050f3ae7755670a1b13e9f26fe8b19fb81042 (diff)
Remove group-permanent-suspension flag
Diffstat (limited to 'orchestrator/src/test')
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java25
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicyTest.java28
2 files changed, 10 insertions, 43 deletions
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java
index 1e29f0ca5de..da8591c6631 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java
@@ -10,7 +10,6 @@ import com.yahoo.vespa.applicationmodel.ServiceInstance;
import com.yahoo.vespa.applicationmodel.ServiceStatus;
import com.yahoo.vespa.applicationmodel.ServiceStatusInfo;
import com.yahoo.vespa.applicationmodel.ServiceType;
-import com.yahoo.vespa.flags.Flags;
import com.yahoo.vespa.flags.InMemoryFlagSource;
import com.yahoo.vespa.orchestrator.OrchestratorUtil;
import com.yahoo.vespa.orchestrator.policy.ClusterParams;
@@ -182,18 +181,6 @@ public class ClusterApiImplTest {
fail();
} catch (HostStateChangeDeniedException e) {
assertThat(e.getMessage(),
- containsString("Changing the state of cfg1 would violate enough-services-up: " +
- "Suspension of service with type 'configserver' not allowed: 33% are suspended already. " +
- "Services down on resumed hosts: [1 missing config server]."));
- }
-
- flagSource.withBooleanFlag(Flags.GROUP_PERMANENT_SUSPENSION.id(), true);
-
- try {
- policy.verifyGroupGoingDownIsFine(clusterApi);
- fail();
- } catch (HostStateChangeDeniedException e) {
- assertThat(e.getMessage(),
containsString("Suspension of service with type 'configserver' not allowed: 33% are suspended already. " +
"Services down on resumed hosts: [1 missing config server]."));
}
@@ -214,18 +201,6 @@ public class ClusterApiImplTest {
fail();
} catch (HostStateChangeDeniedException e) {
assertThat(e.getMessage(),
- containsString("Changing the state of cfg1 would violate enough-services-up: " +
- "Suspension of service with type 'hostadmin' not allowed: 33% are suspended already. " +
- "Services down on resumed hosts: [1 missing config server host]."));
- }
-
- flagSource.withBooleanFlag(Flags.GROUP_PERMANENT_SUSPENSION.id(), true);
-
- try {
- policy.verifyGroupGoingDownIsFine(clusterApi);
- fail();
- } catch (HostStateChangeDeniedException e) {
- assertThat(e.getMessage(),
containsString("Suspension of service with type 'hostadmin' not allowed: 33% are suspended already. " +
"Services down on resumed hosts: [1 missing config server host]."));
}
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicyTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicyTest.java
index 0c3da1656bc..303dabebba8 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicyTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicyTest.java
@@ -63,7 +63,7 @@ public class HostedVespaClusterPolicyTest {
when(clusterApi.clusterId()).thenReturn(VespaModelUtil.ADMIN_CLUSTER_ID);
when(clusterApi.serviceType()).thenReturn(ServiceType.SLOBROK);
assertEquals(ConcurrentSuspensionLimitForCluster.ONE_NODE,
- policy.getConcurrentSuspensionLimit(clusterApi, false));
+ policy.getConcurrentSuspensionLimit(clusterApi));
}
@Test
@@ -71,46 +71,38 @@ public class HostedVespaClusterPolicyTest {
when(clusterApi.clusterId()).thenReturn(VespaModelUtil.ADMIN_CLUSTER_ID);
when(clusterApi.serviceType()).thenReturn(new ServiceType("non-slobrok-service-type"));
assertEquals(ConcurrentSuspensionLimitForCluster.ALL_NODES,
- policy.getConcurrentSuspensionLimit(clusterApi, false));
+ policy.getConcurrentSuspensionLimit(clusterApi));
}
@Test
public void testStorageSuspensionLimit() {
when(clusterApi.serviceType()).thenReturn(ServiceType.STORAGE);
when(clusterApi.clusterId()).thenReturn(new ClusterId("some-cluster-id"));
- when(clusterApi.isStorageCluster()).thenReturn(true);
assertEquals(ConcurrentSuspensionLimitForCluster.ALL_NODES,
- policy.getConcurrentSuspensionLimit(clusterApi, true));
- }
-
- @Test
- public void testStorageSuspensionLimit_legacy() {
- when(clusterApi.clusterId()).thenReturn(new ClusterId("some-cluster-id"));
- when(clusterApi.isStorageCluster()).thenReturn(true);
- assertEquals(ConcurrentSuspensionLimitForCluster.ONE_NODE,
- policy.getConcurrentSuspensionLimit(clusterApi, false));
+ policy.getConcurrentSuspensionLimit(clusterApi));
}
@Test
public void testTenantHostSuspensionLimit() {
when(applicationApi.applicationId()).thenReturn(VespaModelUtil.TENANT_HOST_APPLICATION_ID);
- when(clusterApi.isStorageCluster()).thenReturn(false);
+ when(clusterApi.clusterId()).thenReturn(ClusterId.TENANT_HOST);
+ when(clusterApi.serviceType()).thenReturn(ServiceType.HOST_ADMIN);
assertEquals(ConcurrentSuspensionLimitForCluster.TWENTY_PERCENT,
- policy.getConcurrentSuspensionLimit(clusterApi, false));
+ policy.getConcurrentSuspensionLimit(clusterApi));
when(zone.system()).thenReturn(SystemName.cd);
assertEquals(ConcurrentSuspensionLimitForCluster.FIFTY_PERCENT,
- policy.getConcurrentSuspensionLimit(clusterApi, false));
+ policy.getConcurrentSuspensionLimit(clusterApi));
}
@Test
public void testDefaultSuspensionLimit() {
when(applicationApi.applicationId()).thenReturn(ApplicationId.fromSerializedForm("a:b:c"));
when(clusterApi.clusterId()).thenReturn(new ClusterId("some-cluster-id"));
- when(clusterApi.isStorageCluster()).thenReturn(false);
+ when(clusterApi.serviceType()).thenReturn(new ServiceType("some-service-type"));
assertEquals(ConcurrentSuspensionLimitForCluster.TEN_PERCENT,
- policy.getConcurrentSuspensionLimit(clusterApi, false));
+ policy.getConcurrentSuspensionLimit(clusterApi));
}
@Test
@@ -141,7 +133,7 @@ public class HostedVespaClusterPolicyTest {
when(clusterApi.noServicesOutsideGroupIsDown()).thenReturn(noServicesOutsideGroupIsDown);
when(clusterApi.reasonsForNoServicesInGroupIsUp()).thenReturn(noServicesInGroupIsUp);
when(clusterApi.percentageOfServicesDownIfGroupIsAllowedToBeDown()).thenReturn(20);
- doReturn(ConcurrentSuspensionLimitForCluster.TEN_PERCENT).when(policy).getConcurrentSuspensionLimit(clusterApi, false);
+ doReturn(ConcurrentSuspensionLimitForCluster.TEN_PERCENT).when(policy).getConcurrentSuspensionLimit(clusterApi);
when(applicationApi.applicationId()).thenReturn(ApplicationId.fromSerializedForm("a:b:c"));
when(clusterApi.serviceType()).thenReturn(new ServiceType("service-type"));