-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test cleanup including being less sensitive to single-host span storage #1658
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,14 +144,12 @@ public void evict_detailed() { | |
|
||
@Test | ||
public void evict_oneTraceMultipleSpans() { | ||
Span testSpan1 = span1.toBuilder().traceIdHigh(1L).traceId(123). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test was accidentally testing defaults related to ignoring traceIdHigh. |
||
timestamp(ann1.timestamp).build(); | ||
Span testSpan2 = span2.toBuilder().traceIdHigh(2L).traceId(123). | ||
timestamp(ann2.timestamp).build(); | ||
Span testSpan1 = span1; | ||
Span testSpan2 = span2.toBuilder().traceId(span1.traceId).build(); | ||
|
||
consumer.accept(asList(testSpan1, testSpan2)); | ||
assertThat(store.getTraces(QueryRequest.builder().build())) | ||
.containsOnly(asList(testSpan1), asList(testSpan2)); | ||
.containsOnly(asList(testSpan1, testSpan2)); | ||
|
||
// Since both spans are a part of the same trace, getting down to | ||
// only one span means deleting both (the whole trace) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -519,11 +519,11 @@ public void getTraces_differentiateOnServiceName() { | |
|
||
Span trace2 = Span.builder().traceId(2).name("get").id(2) | ||
.timestamp((today + 2) * 1000) | ||
.addAnnotation(Annotation.create((today + 1) * 1000, CLIENT_SEND, APP_ENDPOINT)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this data had incorrectly aligned timestamps (which wasn't the point of the test) |
||
.addAnnotation(Annotation.create((today + 1) * 1000, SERVER_RECV, WEB_ENDPOINT)) | ||
.addAnnotation(Annotation.create((today + 1) * 1000, SERVER_SEND, WEB_ENDPOINT)) | ||
.addAnnotation(Annotation.create((today + 1) * 1000, CLIENT_RECV, APP_ENDPOINT)) | ||
.addAnnotation(Annotation.create((today + 1) * 1000, "app", APP_ENDPOINT)) | ||
.addAnnotation(Annotation.create((today + 2) * 1000, CLIENT_SEND, APP_ENDPOINT)) | ||
.addAnnotation(Annotation.create((today + 2) * 1000, SERVER_RECV, WEB_ENDPOINT)) | ||
.addAnnotation(Annotation.create((today + 2) * 1000, SERVER_SEND, WEB_ENDPOINT)) | ||
.addAnnotation(Annotation.create((today + 2) * 1000, CLIENT_RECV, APP_ENDPOINT)) | ||
.addAnnotation(Annotation.create((today + 2) * 1000, "app", APP_ENDPOINT)) | ||
.addBinaryAnnotation(BinaryAnnotation.create("local", "app", APP_ENDPOINT)) | ||
.addBinaryAnnotation(BinaryAnnotation.create("app-b", "app", APP_ENDPOINT)) | ||
.build(); | ||
|
@@ -816,23 +816,21 @@ public void clientTimestampAndDurationWinInSharedSpan() { | |
@Test | ||
public void traceWithManySpans() { | ||
Span[] trace = new Span[101]; | ||
trace[0] = TestObjects.TRACE.get(0); | ||
|
||
IntStream.range(0, 100).forEach(i -> { | ||
Span s = TestObjects.TRACE.get(1); | ||
trace[i + 1] = s.toBuilder() | ||
.id(s.id + i) | ||
.timestamp(s.timestamp + i) | ||
.annotations(s.annotations.stream() | ||
.map(a -> Annotation.create(a.timestamp + i, a.value, a.endpoint)) | ||
.collect(toList())) | ||
.build(); | ||
}); | ||
trace[0] = Span.builder().traceId(0xf66529c8cc356aa0L).id(0x93288b4644570496L).name("get") | ||
.timestamp(TODAY * 1000).duration(350 * 1000L) | ||
.addAnnotation(Annotation.create(TODAY * 1000, SERVER_RECV, WEB_ENDPOINT)) | ||
.addAnnotation(Annotation.create((TODAY + 350) * 1000, SERVER_SEND, WEB_ENDPOINT)) | ||
.build(); | ||
|
||
IntStream.range(1, trace.length).forEach(i -> | ||
trace[i] = Span.builder().traceId(trace[0].traceId).parentId(trace[0].id).id(i).name("foo") | ||
.timestamp((TODAY + i) * 1000).duration(10L) | ||
.addBinaryAnnotation(BinaryAnnotation.create(LOCAL_COMPONENT, "", WEB_ENDPOINT)) | ||
.build()); | ||
|
||
accept(trace); | ||
|
||
String serviceName = trace[1].annotations.get(0).endpoint.serviceName; | ||
assertThat(store().getTraces(QueryRequest.builder().serviceName(serviceName).build())) | ||
assertThat(store().getTraces(QueryRequest.builder().build())) | ||
.containsExactly(asList(trace)); | ||
assertThat(store().getTrace(trace[0].traceIdHigh, trace[0].traceId)) | ||
.containsExactly(trace); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is invalid to put a CLIENT_ADDR on a client span. Scrubbed this as it confuses other things