Package zipkin2.storage
Class ITDependencies<T extends StorageComponent>
- java.lang.Object
-
- zipkin2.storage.ITStorage<T>
-
- zipkin2.storage.ITDependencies<T>
-
@TestInstance(PER_CLASS) public abstract class ITDependencies<T extends StorageComponent> extends ITStorage<T>
Base test forSpanStoreimplementations that support dependency aggregation. Subtypes should create a connection to a real backend, even if that backend is in-process.This is a replacement for
zipkin.storage.DependenciesTest. There is some redundancy aszipkin2.internal.DependencyLinkerTestalso defines many of these tests. The redundancy helps ensure integrated storage doesn't fail due to mismapping of data, for example.
-
-
Constructor Summary
Constructors Constructor Description ITDependencies()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Map<Long,List<DependencyLink>>aggregateLinks(List<Span> spans)Returns links aggregated by midnightprotected voidannotationNamedErrorIsntError(org.junit.jupiter.api.TestInfo testInfo)A timeline annotation named error is not a failed span.protected voidcanSearchForIntervalsBesidesToday(org.junit.jupiter.api.TestInfo testInfo)This test shows that dependency links can be filtered at daily granularity.protected voidconfigureStorageForTest(StorageComponent.Builder storage)Configures aStorageComponent.Builderwith parameters for the test being executed.protected voiddependencies_headlessTrace(org.junit.jupiter.api.TestInfo testInfo)Some systems log a different trace id than the root span.protected voiddependencies_loopback(org.junit.jupiter.api.TestInfo testInfo)protected voidduplicateAddress(org.junit.jupiter.api.TestInfo testInfo)This test confirms that the span store can process trace with intermediate spans like the below properly.protected voidempty()Edge-case when there are no spans, or instrumentation isn't logging annotations properly.protected voidendTimeBeforeData(org.junit.jupiter.api.TestInfo testInfo)protected voidendTsAndLookbackMustBePositive()This tests we error prior to executing the call.protected voidendTsInsideTheTrace(org.junit.jupiter.api.TestInfo testInfo)Ensure complete traces are aggregated, even if they complete after endTsprotected voidgetDependencies(org.junit.jupiter.api.TestInfo testInfo)Normally, the root-span is where trace id == span id and parent id == null.protected voidgetDependencies_linksMixedTraceId(org.junit.jupiter.api.TestInfo testInfo)This tests that dependency linking ignores the high-bits of the trace ID when grouping spans for dependency links.protected voidgetDependenciesAllInstrumented(org.junit.jupiter.api.TestInfo testInfo)When all servers are instrumented, they all recordSpan.Kind.SERVERand theSpan.localEndpoint()indicates the service.protected voidinstrumentedClientAndServer(org.junit.jupiter.api.TestInfo testInfo)protected voidinstrumentedProducerAndConsumer(org.junit.jupiter.api.TestInfo testInfo)protected voidintermediateSpans(org.junit.jupiter.api.TestInfo testInfo)This test confirms that the span store can process trace with intermediate spans like the below properly.protected voidlookbackAfterData(org.junit.jupiter.api.TestInfo testInfo)protected voidlooksBackIndefinitely(org.junit.jupiter.api.TestInfo testInfo)protected voidmissingIntermediateSpan(org.junit.jupiter.api.TestInfo testInfo)This shows a missing parent still results in a dependency link when local endpoints changeprotected voidnotInstrumentedClientAndServer(org.junit.jupiter.api.TestInfo testInfo)This test confirms that the span store can detect dependency indicated by local and remote endpoint.protected voidoneway(org.junit.jupiter.api.TestInfo testInfo)Span starts on one host and ends on the other.protected voidoneway_noClient(org.junit.jupiter.api.TestInfo testInfo)Async span starts from an uninstrumented source.protected voidprocessDependencies(List<Span> spans)Override if dependency processing is a separate job: it should complete before returning from this method.protected voidreplayOverwrites(org.junit.jupiter.api.TestInfo testInfo)It should be safe to run dependency link jobs twiceprotected voidspanKindIsNotRequiredWhenEndpointsArePresent(org.junit.jupiter.api.TestInfo testInfo)protected voidunnamedEndpointsAreSkipped(org.junit.jupiter.api.TestInfo testInfo)-
Methods inherited from class zipkin2.storage.ITStorage
accept, accept, assertGetTraceReturns, assertGetTraceReturns, assertGetTraceReturnsEmpty, assertGetTracesReturns, assertGetTracesReturns, assertGetTracesReturnsCount, assertGetTracesReturnsEmpty, assertGetTracesReturnsEmpty, blockWhileInFlight, checkStorage, clear, initializeStoragePerTest, names, newStorageBuilder, requestBuilder, returnsRawSpans, sortTrace, store, testSuffix, traces
-
-
-
-
Method Detail
-
configureStorageForTest
protected final void configureStorageForTest(StorageComponent.Builder storage)
Description copied from class:ITStorageConfigures aStorageComponent.Builderwith parameters for the test being executed.- Specified by:
configureStorageForTestin classITStorage<T extends StorageComponent>
-
processDependencies
protected void processDependencies(List<Span> spans) throws Exception
Override if dependency processing is a separate job: it should complete before returning from this method.- Throws:
Exception
-
getDependencies
@Test protected void getDependencies(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionNormally, the root-span is where trace id == span id and parent id == null. The default is to look back one day from today.- Throws:
Exception
-
getDependencies_linksMixedTraceId
@Test protected void getDependencies_linksMixedTraceId(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionThis tests that dependency linking ignores the high-bits of the trace ID when grouping spans for dependency links. This allows environments with 64-bit instrumentation to participate in the same trace as 128-bit instrumentation.- Throws:
Exception
-
replayOverwrites
@Test protected void replayOverwrites(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionIt should be safe to run dependency link jobs twice- Throws:
Exception
-
empty
@Test protected void empty() throws ExceptionEdge-case when there are no spans, or instrumentation isn't logging annotations properly.- Throws:
Exception
-
getDependenciesAllInstrumented
@Test protected void getDependenciesAllInstrumented(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionWhen all servers are instrumented, they all recordSpan.Kind.SERVERand theSpan.localEndpoint()indicates the service.- Throws:
Exception
-
dependencies_loopback
@Test protected void dependencies_loopback(org.junit.jupiter.api.TestInfo testInfo) throws Exception- Throws:
Exception
-
dependencies_headlessTrace
@Test protected void dependencies_headlessTrace(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionSome systems log a different trace id than the root span. This seems "headless", as we won't see a span whose id is the same as the trace id.- Throws:
Exception
-
looksBackIndefinitely
@Test protected void looksBackIndefinitely(org.junit.jupiter.api.TestInfo testInfo) throws Exception- Throws:
Exception
-
endTsInsideTheTrace
@Test protected void endTsInsideTheTrace(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionEnsure complete traces are aggregated, even if they complete after endTs- Throws:
Exception
-
endTimeBeforeData
@Test protected void endTimeBeforeData(org.junit.jupiter.api.TestInfo testInfo) throws Exception- Throws:
Exception
-
lookbackAfterData
@Test protected void lookbackAfterData(org.junit.jupiter.api.TestInfo testInfo) throws Exception- Throws:
Exception
-
notInstrumentedClientAndServer
@Test protected void notInstrumentedClientAndServer(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionThis test confirms that the span store can detect dependency indicated by local and remote endpoint. Specifically, this detects an uninstrumented client before the trace and an uninstrumented server at the end of it.- Throws:
Exception
-
endTsAndLookbackMustBePositive
@Test protected void endTsAndLookbackMustBePositive()
This tests we error prior to executing the call.
-
instrumentedClientAndServer
@Test protected void instrumentedClientAndServer(org.junit.jupiter.api.TestInfo testInfo) throws Exception- Throws:
Exception
-
instrumentedProducerAndConsumer
@Test protected void instrumentedProducerAndConsumer(org.junit.jupiter.api.TestInfo testInfo) throws Exception- Throws:
Exception
-
missingIntermediateSpan
@Test protected void missingIntermediateSpan(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionThis shows a missing parent still results in a dependency link when local endpoints change- Throws:
Exception
-
canSearchForIntervalsBesidesToday
@Test protected void canSearchForIntervalsBesidesToday(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionThis test shows that dependency links can be filtered at daily granularity. This allows the UI to look for dependency intervals besides TODAY.- Throws:
Exception
-
spanKindIsNotRequiredWhenEndpointsArePresent
@Test protected void spanKindIsNotRequiredWhenEndpointsArePresent(org.junit.jupiter.api.TestInfo testInfo) throws Exception- Throws:
Exception
-
unnamedEndpointsAreSkipped
@Test protected void unnamedEndpointsAreSkipped(org.junit.jupiter.api.TestInfo testInfo) throws Exception- Throws:
Exception
-
intermediateSpans
@Test protected void intermediateSpans(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionThis test confirms that the span store can process trace with intermediate spans like the below properly.span1: SR SS span2: intermediate call span3: CS SR SS CR: Dependency 1
- Throws:
Exception
-
duplicateAddress
@Test protected void duplicateAddress(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionThis test confirms that the span store can process trace with intermediate spans like the below properly.span1: SR SS span2: intermediate call span3: CS SR SS CR: Dependency 1
- Throws:
Exception
-
oneway
@Test protected void oneway(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionSpan starts on one host and ends on the other. In both cases, a response is neither sent nor received.- Throws:
Exception
-
annotationNamedErrorIsntError
@Test protected void annotationNamedErrorIsntError(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionA timeline annotation named error is not a failed span. A tag/binary annotation is.- Throws:
Exception
-
oneway_noClient
@Test protected void oneway_noClient(org.junit.jupiter.api.TestInfo testInfo) throws ExceptionAsync span starts from an uninstrumented source.- Throws:
Exception
-
-