use of com.yahoo.config.provision.OutOfCapacityException in project vespa by vespa-engine.
the class ProvisioningTest method out_of_capacity_no_replacements_for_retired_flavor.
@Test
public void out_of_capacity_no_replacements_for_retired_flavor() {
String flavorToRetire = "default";
String replacementFlavor = "new-default";
FlavorConfigBuilder b = new FlavorConfigBuilder();
b.addFlavor(flavorToRetire, 1., 1., 10, Flavor.Type.BARE_METAL).cost(2).retired(true);
FlavorsConfig.Flavor.Builder newDefault = b.addFlavor(replacementFlavor, 2., 2., 20, Flavor.Type.BARE_METAL).cost(2);
b.addReplaces(flavorToRetire, newDefault);
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")), b.build());
ApplicationId application = tester.makeApplicationId();
try {
prepare(application, 2, 0, 2, 0, flavorToRetire, tester);
fail("Expected exception");
} catch (OutOfCapacityException e) {
assertTrue(e.getMessage().startsWith("Could not satisfy request"));
}
}
use of com.yahoo.config.provision.OutOfCapacityException in project vespa by vespa-engine.
the class ProvisioningTest method out_of_capacity.
@Test
public void out_of_capacity() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")));
// need 2+2+3+3=10
tester.makeReadyNodes(9, "default");
ApplicationId application = tester.makeApplicationId();
try {
prepare(application, 2, 2, 3, 3, "default", tester);
fail("Expected exception");
} catch (OutOfCapacityException e) {
assertTrue(e.getMessage().startsWith("Could not satisfy request"));
}
}
use of com.yahoo.config.provision.OutOfCapacityException in project vespa by vespa-engine.
the class VirtualNodeProvisioningTest method indistinct_distribution_with_known_ready_nodes.
@Test
public void indistinct_distribution_with_known_ready_nodes() {
tester.makeReadyVirtualNodes(3, flavor, Optional.empty());
final int contentNodeCount = 3;
final int groups = 1;
final List<HostSpec> contentHosts = prepare(contentClusterSpec, contentNodeCount, groups);
activate(contentHosts);
List<Node> nodes = getNodes(applicationId);
assertEquals(3, nodes.size());
// Set indistinct parents
tester.patchNode(nodes.get(0).withParentHostname("parentHost1"));
tester.patchNode(nodes.get(1).withParentHostname("parentHost1"));
tester.patchNode(nodes.get(2).withParentHostname("parentHost2"));
nodes = getNodes(applicationId);
assertEquals(3, nodes.stream().filter(n -> n.parentHostname().isPresent()).count());
tester.makeReadyVirtualNodes(1, flavor, "parentHost1");
tester.makeReadyVirtualNodes(2, flavor, "parentHost2");
OutOfCapacityException expectedException = null;
try {
prepare(contentClusterSpec, contentNodeCount, groups);
} catch (OutOfCapacityException e) {
expectedException = e;
}
assertNotNull(expectedException);
}
use of com.yahoo.config.provision.OutOfCapacityException in project vespa by vespa-engine.
the class ProvisioningTest method out_of_capacity_all_nodes_want_to_retire.
@Test
public void out_of_capacity_all_nodes_want_to_retire() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")));
ApplicationId application = tester.makeApplicationId();
// Flag all nodes for retirement
List<Node> readyNodes = tester.makeReadyNodes(5, "default");
readyNodes.forEach(node -> tester.patchNode(node.with(node.status().withWantToRetire(true))));
try {
prepare(application, 2, 0, 2, 0, "default", tester);
fail("Expected exception");
} catch (OutOfCapacityException e) {
assertTrue(e.getMessage().startsWith("Could not satisfy request"));
}
}
use of com.yahoo.config.provision.OutOfCapacityException in project vespa by vespa-engine.
the class ProvisioningTest method out_of_desired_flavor.
@Test
public void out_of_desired_flavor() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")));
// need 2+2+3+3=10
tester.makeReadyNodes(10, "small");
// need 2+2+3+3=10
tester.makeReadyNodes(9, "large");
ApplicationId application = tester.makeApplicationId();
try {
prepare(application, 2, 2, 3, 3, "large", tester);
fail("Expected exception");
} catch (OutOfCapacityException e) {
assertTrue(e.getMessage().startsWith("Could not satisfy request for 3 nodes of flavor 'large'"));
}
}
Aggregations