use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.
the class PermanentApplicationPackageTest method testNonexistingApplication.
@Test
public void testNonexistingApplication() {
PermanentApplicationPackage permanentApplicationPackage = new PermanentApplicationPackage(new ConfigserverConfig(new ConfigserverConfig.Builder().applicationDirectory("_no_such_dir")));
assertFalse(permanentApplicationPackage.applicationPackage().isPresent());
}
use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.
the class UnionMonitorManagerTest method testWith.
private void testWith(boolean nodeAdminInContainer, ApplicationId applicationId, ClusterId clusterId, ServiceType serviceType, int expectedSlobrokCalls, int expectedHealthCalls) {
SlobrokMonitorManagerImpl slobrokMonitorManager = mock(SlobrokMonitorManagerImpl.class);
HealthMonitorManager healthMonitorManager = mock(HealthMonitorManager.class);
ConfigserverConfig.Builder builder = new ConfigserverConfig.Builder();
builder.nodeAdminInContainer(nodeAdminInContainer);
ConfigserverConfig config = new ConfigserverConfig(builder);
UnionMonitorManager manager = new UnionMonitorManager(slobrokMonitorManager, healthMonitorManager, config);
manager.getStatus(applicationId, clusterId, serviceType, new ConfigId("config-id"));
verify(slobrokMonitorManager, times(expectedSlobrokCalls)).getStatus(any(), any(), any(), any());
verify(healthMonitorManager, times(expectedHealthCalls)).getStatus(any(), any(), any(), any());
}
use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.
the class NodeFailerTest method not_failed_without_config_requests_if_node_admin_on_host.
@Test
public void not_failed_without_config_requests_if_node_admin_on_host() {
NodeFailTester tester = NodeFailTester.withTwoApplications(new ConfigserverConfig(new ConfigserverConfig.Builder().nodeAdminInContainer(false)));
// For a day all nodes work so nothing happens
for (int minutes = 0, interval = 30; minutes < 24 * 60; minutes += interval) {
tester.clock.advance(Duration.ofMinutes(interval));
tester.allNodesMakeAConfigRequestExcept();
tester.failer.run();
assertEquals(3, tester.nodeRepository.getNodes(NodeType.host, Node.State.ready).size());
assertEquals(0, tester.nodeRepository.getNodes(NodeType.host, Node.State.failed).size());
}
// Two ready nodes and a ready docker node die, but only 2 of those are failed out
tester.clock.advance(Duration.ofMinutes(180));
Node dockerHost = tester.nodeRepository.getNodes(NodeType.host, Node.State.ready).iterator().next();
tester.allNodesMakeAConfigRequestExcept(dockerHost);
tester.failer.run();
assertEquals(3, tester.nodeRepository.getNodes(NodeType.host, Node.State.ready).size());
assertEquals(0, tester.nodeRepository.getNodes(NodeType.host, Node.State.failed).size());
}
Aggregations