Search in sources :

Example 21 with ConfigserverConfig

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());
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) Test(org.junit.Test)

Example 22 with ConfigserverConfig

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());
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) ConfigId(com.yahoo.vespa.applicationmodel.ConfigId)

Example 23 with ConfigserverConfig

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());
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) Node(com.yahoo.vespa.hosted.provision.Node) Test(org.junit.Test)

Aggregations

ConfigserverConfig (com.yahoo.cloud.config.ConfigserverConfig)23 Test (org.junit.Test)16 File (java.io.File)4 RpcServer (com.yahoo.vespa.config.server.rpc.RpcServer)3 Before (org.junit.Before)3 Zone (com.yahoo.config.provision.Zone)2 PermanentApplicationPackage (com.yahoo.vespa.config.server.application.PermanentApplicationPackage)2 DeployTester (com.yahoo.vespa.config.server.deploy.DeployTester)2 FileServer (com.yahoo.vespa.config.server.filedistribution.FileServer)2 HostRegistries (com.yahoo.vespa.config.server.host.HostRegistries)2 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)2 VersionState (com.yahoo.vespa.config.server.version.VersionState)2 MockCurator (com.yahoo.vespa.curator.mock.MockCurator)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ComponentRegistry (com.yahoo.component.provider.ComponentRegistry)1 NullConfigModelRegistry (com.yahoo.config.model.NullConfigModelRegistry)1 DeployProperties (com.yahoo.config.model.deploy.DeployProperties)1 DeployState (com.yahoo.config.model.deploy.DeployState)1 MockRoot (com.yahoo.config.model.test.MockRoot)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1