diff --git a/cmd/query/app/grpc_handler.go b/cmd/query/app/grpc_handler.go index 64669ed3e4e..7cbeab083cb 100644 --- a/cmd/query/app/grpc_handler.go +++ b/cmd/query/app/grpc_handler.go @@ -223,7 +223,7 @@ func (g *GRPCHandler) GetDependencies(ctx context.Context, r *api_v2.GetDependen return nil, status.Errorf(codes.InvalidArgument, "StartTime and EndTime must be initialized.") } - dependencies, err := g.queryService.GetDependencies(ctx, startTime, endTime.Sub(startTime)) + dependencies, err := g.queryService.GetDependencies(ctx, endTime, endTime.Sub(startTime)) if err != nil { g.logger.Error("failed to fetch dependencies", zap.Error(err)) return nil, status.Errorf(codes.Internal, "failed to fetch dependencies: %v", err) diff --git a/cmd/query/app/grpc_handler_test.go b/cmd/query/app/grpc_handler_test.go index 55dcf2affa7..273f2a2f712 100644 --- a/cmd/query/app/grpc_handler_test.go +++ b/cmd/query/app/grpc_handler_test.go @@ -513,7 +513,7 @@ func TestGetDependenciesSuccessGRPC(t *testing.T) { endTs := time.Now().UTC() server.depReader.On("GetDependencies", mock.Anything, // context.Context - endTs.Add(time.Duration(-1)*defaultDependencyLookbackDuration), + endTs, defaultDependencyLookbackDuration, ).Return(expectedDependencies, nil).Times(1) @@ -532,7 +532,7 @@ func TestGetDependenciesFailureGRPC(t *testing.T) { server.depReader.On( "GetDependencies", mock.Anything, // context.Context - endTs.Add(time.Duration(-1)*defaultDependencyLookbackDuration), + endTs, defaultDependencyLookbackDuration).Return(nil, errStorageGRPC).Times(1) _, err := client.GetDependencies(context.Background(), &api_v2.GetDependenciesRequest{