Skip to content
This repository has been archived by the owner on May 18, 2020. It is now read-only.

Commit

Permalink
Elasticsearch deploy two replicas (#46)
Browse files Browse the repository at this point in the history
* Elasticsearch deploy two replicas

Signed-off-by: Pavol Loffay <[email protected]>

* Create span before each ES test

Signed-off-by: Pavol Loffay <[email protected]>

* Add link

Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay authored Oct 11, 2017
1 parent f527fbb commit 37bce8b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@ public class BaseETest {
private static final String COLLECTOR_SERVICE_NAME = "jaeger-collector";
private static final String ZIPKIN_SERVICE_NAME = "zipkin";

private OkHttpClient okHttpClient = new OkHttpClient.Builder()
protected OkHttpClient okHttpClient = new OkHttpClient.Builder()
.build();

@Named(QUERY_SERVICE_NAME)
@PortForward
@ArquillianResource
private URL queryUrl;
protected URL queryUrl;

@Port(14268)
@Named(COLLECTOR_SERVICE_NAME)
@PortForward
@ArquillianResource
private URL collectorUrl;
protected URL collectorUrl;

@Port(9411)
@Named(ZIPKIN_SERVICE_NAME)
@PortForward
@ArquillianResource
private URL zipkinUrl;
protected URL zipkinUrl;

@Test
public void testUiResponds() throws IOException, InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ items:
kind: StatefulSet
metadata:
name: elasticsearch
labels:
app: jaeger
jaeger-infra: elasticsearch-statefulset
spec:
serviceName: elasticsearch
replicas: 1
replicas: 2
template:
metadata:
labels:
app: jaeger
type: databases
availability: restricted
jaeger-infra: elasticsearch-statefulset
app: jaeger-elasticsearch
jaeger-infra: elasticsearch-replica
spec:
containers:
- name: elasticsearch
Expand All @@ -39,6 +40,7 @@ items:
args:
- "-Ehttp.host=0.0.0.0"
- "-Etransport.host=127.0.0.1"
- "-Ecluster.name=foobar"
volumeMounts:
- name: data
mountPath: /data
Expand All @@ -55,10 +57,12 @@ items:
spec:
clusterIP: None
selector:
app: elasticsearch
app: jaeger-elasticsearch
ports:
- port: 9200
name: elasticsearch
- port: 9300
name: transport
- apiVersion: extensions/v1beta1
kind: Deployment
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,46 @@
*/
package io.jaegertracing.kubernetes;

import com.uber.jaeger.Tracer;
import io.jaegertracing.kubernetes.deployment.BaseETest;
import java.io.IOException;
import org.junit.Ignore;
import java.util.UUID;
import okhttp3.Request;
import okhttp3.Response;
import org.junit.Before;

import static org.awaitility.Awaitility.await;

/**
* @author Pavol Loffay
*/
public class ProductionETest extends BaseETest {

/**
* We need to initialize ES storage, before we proceed to tests for two reasons:
* 1. sometimes first span is not stored
* 2. jaeger-query returns 500 is ES storage is empty (without indices) https://github.com/jaegertracing/jaeger/issues/464
*/
@Before
public void before() {
String serviceName = UUID.randomUUID().toString().replace("-", "");
Tracer tracer = createJaegerTracer(serviceName);
String operationName = UUID.randomUUID().toString().replace("-", "");
tracer.buildSpan(operationName).startManual().finish();
tracer.close();

Request request = new Request.Builder()
.url(queryUrl + "api/traces?service=" + serviceName)
.get()
.build();

await().until(() -> {
Response response = okHttpClient.newCall(request).execute();
String body = response.body().string();
return body.contains(operationName);
});
}

public void testDependencyLinks() throws IOException, InterruptedException {
}
}

0 comments on commit 37bce8b

Please sign in to comment.