use of zipkin2.elasticsearch.ElasticsearchStorage in project zipkin by openzipkin.
the class ITElasticsearchHealthCheck method healthyThenNotHealthyThenHealthy.
// If this flakes, uncomment in initWithHosts and log4j2.properties
@Test
public void healthyThenNotHealthyThenHealthy() {
try (ElasticsearchStorage storage = context.getBean(ElasticsearchStorage.class)) {
assertOk(storage.check());
logger.info("setting server 1 and 2 unhealthy");
server1Health.setHealthy(false);
server2Health.setHealthy(false);
awaitTimeout.untilAsserted(() -> assertThat(storage.check().ok()).isFalse());
logger.info("setting server 1 healthy");
server1Health.setHealthy(true);
awaitTimeout.untilAsserted(() -> assertThat(storage.check().ok()).isTrue());
}
}
use of zipkin2.elasticsearch.ElasticsearchStorage in project zipkin by openzipkin.
the class ITElasticsearchHealthCheck method noneHealthy.
@Test
public void noneHealthy() {
server1Health.setHealthy(false);
server2Health.setHealthy(false);
try (ElasticsearchStorage storage = context.getBean(ElasticsearchStorage.class)) {
CheckResult result = storage.check();
assertThat(result.ok()).isFalse();
assertThat(result.error()).isInstanceOf(EmptyEndpointGroupException.class);
}
}
Aggregations