diff --git a/cmd/query/app/grpc_handler_test.go b/cmd/query/app/grpc_handler_test.go index 55dcf2affa7..9969625ec3a 100644 --- a/cmd/query/app/grpc_handler_test.go +++ b/cmd/query/app/grpc_handler_test.go @@ -28,11 +28,12 @@ import ( "github.com/jaegertracing/jaeger/plugin/metricstore/disabled" "github.com/jaegertracing/jaeger/proto-gen/api_v2" "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" - depsmocks "github.com/jaegertracing/jaeger/storage/dependencystore/mocks" "github.com/jaegertracing/jaeger/storage/metricstore" metricsmocks "github.com/jaegertracing/jaeger/storage/metricstore/mocks" "github.com/jaegertracing/jaeger/storage/spanstore" spanstoremocks "github.com/jaegertracing/jaeger/storage/spanstore/mocks" + "github.com/jaegertracing/jaeger/storage_v2/depstore" + depsmocks "github.com/jaegertracing/jaeger/storage_v2/depstore/mocks" "github.com/jaegertracing/jaeger/storage_v2/factoryadapter" ) @@ -511,10 +512,13 @@ func TestGetDependenciesSuccessGRPC(t *testing.T) { withServerAndClient(t, func(server *grpcServer, client *grpcClient) { expectedDependencies := []model.DependencyLink{{Parent: "killer", Child: "queen", CallCount: 12}} endTs := time.Now().UTC() + expectedEndTs := endTs.Add(time.Duration(-1) * defaultDependencyLookbackDuration) server.depReader.On("GetDependencies", mock.Anything, // context.Context - endTs.Add(time.Duration(-1)*defaultDependencyLookbackDuration), - defaultDependencyLookbackDuration, + depstore.QueryParameters{ + StartTime: expectedEndTs.Add(-defaultDependencyLookbackDuration), + EndTime: expectedEndTs, + }, ).Return(expectedDependencies, nil).Times(1) res, err := client.GetDependencies(context.Background(), &api_v2.GetDependenciesRequest{ @@ -529,11 +533,14 @@ func TestGetDependenciesSuccessGRPC(t *testing.T) { func TestGetDependenciesFailureGRPC(t *testing.T) { withServerAndClient(t, func(server *grpcServer, client *grpcClient) { endTs := time.Now().UTC() - server.depReader.On( - "GetDependencies", + expectedEndTs := endTs.Add(time.Duration(-1) * defaultDependencyLookbackDuration) + server.depReader.On("GetDependencies", mock.Anything, // context.Context - endTs.Add(time.Duration(-1)*defaultDependencyLookbackDuration), - defaultDependencyLookbackDuration).Return(nil, errStorageGRPC).Times(1) + depstore.QueryParameters{ + StartTime: expectedEndTs.Add(-defaultDependencyLookbackDuration), + EndTime: expectedEndTs, + }, + ).Return(nil, errStorageGRPC).Times(1) _, err := client.GetDependencies(context.Background(), &api_v2.GetDependenciesRequest{ StartTime: endTs.Add(time.Duration(-1) * defaultDependencyLookbackDuration), diff --git a/cmd/query/app/handler_deps_test.go b/cmd/query/app/handler_deps_test.go index ff71efe62cf..e24799c00ce 100644 --- a/cmd/query/app/handler_deps_test.go +++ b/cmd/query/app/handler_deps_test.go @@ -15,6 +15,7 @@ import ( "github.com/jaegertracing/jaeger/model" ui "github.com/jaegertracing/jaeger/model/json" + "github.com/jaegertracing/jaeger/storage_v2/depstore" ) func TestDeduplicateDependencies(t *testing.T) { @@ -304,8 +305,10 @@ func TestGetDependenciesSuccess(t *testing.T) { endTs := time.Unix(0, 1476374248550*millisToNanosMultiplier) ts.dependencyReader.On("GetDependencies", mock.Anything, // context - endTs, - defaultDependencyLookbackDuration, + depstore.QueryParameters{ + StartTime: endTs.Add(-defaultDependencyLookbackDuration), + EndTime: endTs, + }, ).Return(expectedDependencies, nil).Times(1) var response structuredResponse @@ -324,8 +327,11 @@ func TestGetDependenciesCassandraFailure(t *testing.T) { endTs := time.Unix(0, 1476374248550*millisToNanosMultiplier) ts.dependencyReader.On("GetDependencies", mock.Anything, // context - endTs, - defaultDependencyLookbackDuration).Return(nil, errStorage).Times(1) + depstore.QueryParameters{ + StartTime: endTs.Add(-defaultDependencyLookbackDuration), + EndTime: endTs, + }, + ).Return(nil, errStorage).Times(1) var response structuredResponse err := getJSON(ts.server.URL+"/api/dependencies?endTs=1476374248550&service=testing", &response)