diff --git a/service/history/decision/handler_test.go b/service/history/decision/handler_test.go index 7eebd295941..18a3bb2b342 100644 --- a/service/history/decision/handler_test.go +++ b/service/history/decision/handler_test.go @@ -23,6 +23,7 @@ package decision import ( "context" "errors" + "fmt" "reflect" "testing" @@ -30,6 +31,8 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/uber-go/tally" + "go.uber.org/zap" + "go.uber.org/zap/zaptest/observer" "github.com/uber/cadence/common" "github.com/uber/cadence/common/cache" @@ -37,6 +40,7 @@ import ( "github.com/uber/cadence/common/clock" "github.com/uber/cadence/common/cluster" commonConfig "github.com/uber/cadence/common/config" + "github.com/uber/cadence/common/log/loggerimpl" "github.com/uber/cadence/common/log/testlogger" "github.com/uber/cadence/common/metrics" "github.com/uber/cadence/common/persistence" @@ -390,6 +394,7 @@ func (s *DecisionHandlerSuite) TestHandleDecisionTaskStarted() { mutablestate *persistence.WorkflowMutableState expectCalls func(h *handlerImpl) expectErr error + assertCalls func(response *types.RecordDecisionTaskStartedResponse) }{ { name: "fail to retrieve domain From ID", @@ -399,6 +404,7 @@ func (s *DecisionHandlerSuite) TestHandleDecisionTaskStarted() { mutablestate: &persistence.WorkflowMutableState{ ExecutionInfo: &persistence.WorkflowExecutionInfo{}, }, + assertCalls: func(response *types.RecordDecisionTaskStartedResponse) {}, }, { name: "failure - decision task already started", @@ -410,6 +416,7 @@ func (s *DecisionHandlerSuite) TestHandleDecisionTaskStarted() { mutablestate: &persistence.WorkflowMutableState{ ExecutionInfo: &persistence.WorkflowExecutionInfo{}, }, + assertCalls: func(response *types.RecordDecisionTaskStartedResponse) {}, }, { name: "failure - workflow completed", @@ -423,6 +430,7 @@ func (s *DecisionHandlerSuite) TestHandleDecisionTaskStarted() { State: 2, //2 == WorkflowStateCompleted }, }, + assertCalls: func(response *types.RecordDecisionTaskStartedResponse) {}, }, { name: "failure - decision task already completed", @@ -437,6 +445,7 @@ func (s *DecisionHandlerSuite) TestHandleDecisionTaskStarted() { NextEventID: 2, }, }, + assertCalls: func(response *types.RecordDecisionTaskStartedResponse) {}, }, { name: "failure - cached mutable state is stale", @@ -452,6 +461,7 @@ func (s *DecisionHandlerSuite) TestHandleDecisionTaskStarted() { DecisionScheduleID: 1, }, }, + assertCalls: func(response *types.RecordDecisionTaskStartedResponse) {}, }, { name: "success", @@ -462,11 +472,43 @@ func (s *DecisionHandlerSuite) TestHandleDecisionTaskStarted() { expectErr: nil, mutablestate: &persistence.WorkflowMutableState{ ExecutionInfo: &persistence.WorkflowExecutionInfo{ - DecisionScheduleID: 0, - NextEventID: 3, - DecisionRequestID: "test-request-id", + NextEventID: 3, + DecisionRequestID: "test-request-id", + DecisionAttempt: 1, }, }, + assertCalls: func(resp *types.RecordDecisionTaskStartedResponse) { + // expect test.mutablestate.ExecutionInfo.DecisionAttempt + s.Equal(int64(1), resp.DecisionInfo.ScheduledEvent.DecisionTaskScheduledEventAttributes.Attempt) + }, + }, + { + name: "success - decision startedID is empty", + domainID: _testDomainUUID, + expectCalls: func(h *handlerImpl) { + h.shard.(*shard.MockContext).EXPECT().GetEventsCache().Times(1).Return(events.NewMockCache(s.controller)) + h.shard.(*shard.MockContext).EXPECT().GenerateTransferTaskIDs(gomock.Any()).Times(1).Return([]int64{0}, nil) + h.shard.(*shard.MockContext).EXPECT(). + AppendHistoryV2Events(gomock.Any(), gomock.Any(), _testDomainUUID, types.WorkflowExecution{WorkflowID: _testWorkflowID, RunID: _testRunID}). + Return(&persistence.AppendHistoryNodesResponse{}, nil) + h.shard.(*shard.MockContext).EXPECT().UpdateWorkflowExecution(gomock.Any(), gomock.Any()).Return(&persistence.UpdateWorkflowExecutionResponse{MutableStateUpdateSessionStats: &persistence.MutableStateUpdateSessionStats{}}, nil) + h.shard.(*shard.MockContext).EXPECT().GetShardID().Return(_testShardID) + engine := engine.NewMockEngine(s.controller) + h.shard.(*shard.MockContext).EXPECT().GetEngine().Times(3).Return(engine) + engine.EXPECT().NotifyNewHistoryEvent(gomock.Any()) + engine.EXPECT().NotifyNewTransferTasks(gomock.Any()) + engine.EXPECT().NotifyNewTimerTasks(gomock.Any()) + engine.EXPECT().NotifyNewCrossClusterTasks(gomock.Any()) + engine.EXPECT().NotifyNewReplicationTasks(gomock.Any()) + }, + expectErr: nil, + mutablestate: &persistence.WorkflowMutableState{ + ExecutionInfo: &persistence.WorkflowExecutionInfo{ + DecisionStartedID: -23, + NextEventID: 2, + }, + }, + assertCalls: func(resp *types.RecordDecisionTaskStartedResponse) {}, }, } @@ -478,14 +520,10 @@ func (s *DecisionHandlerSuite) TestHandleDecisionTaskStarted() { WorkflowID: _testWorkflowID, RunID: _testRunID, }, - ScheduleID: 0, - TaskID: 0, - RequestID: "test-request-id", + RequestID: "test-request-id", PollRequest: &types.PollForDecisionTaskRequest{ - Domain: test.domainID, - TaskList: nil, - Identity: "", - BinaryChecksum: "", + Domain: test.domainID, + Identity: "test-identity", }, } shardContext := shard.NewMockContext(s.controller) @@ -498,6 +536,74 @@ func (s *DecisionHandlerSuite) TestHandleDecisionTaskStarted() { s.Equal(test.expectErr, err) if err == nil { s.NotNil(resp) + s.Equal(test.mutablestate.ExecutionInfo.DecisionScheduleID, resp.ScheduledEventID) + s.Equal(test.mutablestate.ExecutionInfo.DecisionStartedID, resp.StartedEventID) + s.Equal(test.mutablestate.ExecutionInfo.NextEventID, resp.NextEventID) + s.Equal(test.mutablestate.ExecutionInfo.TaskList, resp.WorkflowExecutionTaskList.Name) + } + test.assertCalls(resp) + }) + } +} + +func (s *DecisionHandlerSuite) TestCreateRecordDecisionTaskStartedResponse() { + tests := []struct { + name string + expectCalls func() + expectedErr error + indexes []string + }{ + { + name: "success", + expectCalls: func() { + s.mockMutableState.EXPECT().GetWorkflowType().Return(&types.WorkflowType{}) + s.mockMutableState.EXPECT().GetNextEventID().Return(int64(1)) + s.mockMutableState.EXPECT().CreateTransientDecisionEvents(gomock.Any(), "test-identity").Return(&types.HistoryEvent{}, &types.HistoryEvent{}) + s.mockMutableState.EXPECT().GetCurrentBranchToken().Return([]byte{}, nil) + registry := query.NewMockRegistry(s.controller) + s.mockMutableState.EXPECT().GetQueryRegistry().Return(registry) + registry.EXPECT().GetBufferedIDs().Return([]string{"test-id", "test-id1", "test-id2"}) + registry.EXPECT().GetQueryInput(gomock.Any()).Return(&types.WorkflowQuery{}, nil).Times(2) + registry.EXPECT().GetQueryInput(gomock.Any()).Return(nil, &types.InternalServiceError{Message: "query does not exist"}) + s.mockMutableState.EXPECT().GetHistorySize() + }, + expectedErr: nil, + indexes: []string{"test-id", "test-id1"}, + }, + { + name: "failure", + expectCalls: func() { + s.mockMutableState.EXPECT().GetWorkflowType().Return(&types.WorkflowType{}) + s.mockMutableState.EXPECT().GetNextEventID().Return(int64(1)) + s.mockMutableState.EXPECT().CreateTransientDecisionEvents(gomock.Any(), "test-identity").Return(&types.HistoryEvent{}, &types.HistoryEvent{}) + s.mockMutableState.EXPECT().GetCurrentBranchToken().Return([]byte{}, &types.BadRequestError{Message: fmt.Sprintf("getting branch index: %d, available branch count: %d", 0, 0)}) + }, + expectedErr: &types.BadRequestError{Message: fmt.Sprintf("getting branch index: %d, available branch count: %d", 0, 0)}, + }, + } + + for _, test := range tests { + s.Run(test.name, func() { + decision := &execution.DecisionInfo{ + ScheduleID: 1, + StartedID: 2, + RequestID: constants.TestRequestID, + TaskList: "test-tasklist", + Attempt: 1, + } + test.expectCalls() + resp, err := s.decisionHandler.createRecordDecisionTaskStartedResponse(constants.TestDomainID, s.mockMutableState, decision, "test-identity") + s.Equal(test.expectedErr, err) + if err != nil { + s.Nil(resp) + } else { + s.Equal(&types.HistoryEvent{}, resp.DecisionInfo.ScheduledEvent) + s.Equal(&types.HistoryEvent{}, resp.DecisionInfo.StartedEvent) + s.Equal([]byte{}, resp.BranchToken) + for _, index := range test.indexes { + _, ok := resp.Queries[index] + s.True(ok) + } } }) } @@ -547,6 +653,84 @@ func (s *DecisionHandlerSuite) TestHandleBufferedQueries_QueryTooLarge() { s.assertQueryCounts(s.queryRegistry, 0, 5, 0, 5) } +func (s *DecisionHandlerSuite) TestHandleBufferedQueries_QueryRegistryFailures() { + tests := []struct { + name string + expectMockCalls func() + assertCalls func(logs *observer.ObservedLogs) + clientFeatureVersion string + queryResults map[string]*types.WorkflowQueryResult + }{ + { + name: "no buffered queries", + expectMockCalls: func() { + queryRegistry := query.NewMockRegistry(s.controller) + s.mockMutableState.EXPECT().GetQueryRegistry().Return(queryRegistry) + queryRegistry.EXPECT().HasBufferedQuery().Return(false) + }, + assertCalls: func(logs *observer.ObservedLogs) {}, + }, + { + name: "set query termination state failed - client unsupported", + expectMockCalls: func() { + queryRegistry := query.NewMockRegistry(s.controller) + s.mockMutableState.EXPECT().GetQueryRegistry().Return(queryRegistry) + queryRegistry.EXPECT().HasBufferedQuery().Return(true) + queryRegistry.EXPECT().GetBufferedIDs().Return([]string{"some-buffered-id"}) + queryRegistry.EXPECT().SetTerminationState("some-buffered-id", gomock.Any()).Return(&types.InternalServiceError{Message: "query does not exist"}) + }, + assertCalls: func(logs *observer.ObservedLogs) { + s.Equal(1, logs.FilterMessage("failed to set query termination state to failed").Len()) + }, + clientFeatureVersion: "0.0.0", + }, + { + name: "set query termination state failed - query too large", + expectMockCalls: func() { + queryRegistry := query.NewMockRegistry(s.controller) + s.mockMutableState.EXPECT().GetQueryRegistry().Return(queryRegistry) + queryRegistry.EXPECT().HasBufferedQuery().Return(true) + queryRegistry.EXPECT().GetBufferedIDs().Return([]string{"some-id"}) + queryRegistry.EXPECT().SetTerminationState("some-id", gomock.Any()).Return(&types.InternalServiceError{Message: "query already in terminal state"}).Times(2) + }, + queryResults: s.constructQueryResults([]string{"some-id"}, 10*1024*1024), + clientFeatureVersion: client.GoWorkerConsistentQueryVersion, + assertCalls: func(logs *observer.ObservedLogs) { + s.Equal(1, logs.FilterMessage("failed to set query termination state to failed").Len()) + s.Equal(1, logs.FilterMessage("failed to set query termination state to unblocked").Len()) + }, + }, + { + name: "set query termination state unblocked", + expectMockCalls: func() { + queryRegistry := query.NewMockRegistry(s.controller) + s.mockMutableState.EXPECT().GetQueryRegistry().Return(queryRegistry) + queryRegistry.EXPECT().HasBufferedQuery().Return(true) + queryRegistry.EXPECT().GetBufferedIDs().Return([]string{"some-buffered-id"}) + queryRegistry.EXPECT().SetTerminationState("some-id", gomock.Any()).Return(&types.InternalServiceError{Message: "query does not exist"}) + queryRegistry.EXPECT().SetTerminationState("some-buffered-id", gomock.Any()).Return(&types.InternalServiceError{Message: "query already in terminal state"}) + }, + clientFeatureVersion: client.GoWorkerConsistentQueryVersion, + queryResults: map[string]*types.WorkflowQueryResult{"some-id": &types.WorkflowQueryResult{}}, + assertCalls: func(logs *observer.ObservedLogs) { + s.Equal(1, logs.FilterMessage("failed to set query termination state to completed").Len()) + s.Equal(1, logs.FilterMessage("failed to set query termination state to unblocked").Len()) + }, + }, + } + for _, test := range tests { + s.Run(test.name, func() { + core, observedLogs := observer.New(zap.ErrorLevel) + logger := zap.New(core) + s.decisionHandler.logger = loggerimpl.NewLogger(logger, loggerimpl.WithSampleFunc(func(int) bool { return true })) + + test.expectMockCalls() + s.decisionHandler.handleBufferedQueries(s.mockMutableState, client.GoSDK, test.clientFeatureVersion, test.queryResults, false, constants.TestGlobalDomainEntry, false) + test.assertCalls(observedLogs) + }) + } +} + func (s *DecisionHandlerSuite) constructQueryResults(ids []string, resultSize int) map[string]*types.WorkflowQueryResult { results := make(map[string]*types.WorkflowQueryResult) for _, id := range ids { diff --git a/service/history/query/registry.go b/service/history/query/registry.go index 6c08391a71a..2f963556c29 100644 --- a/service/history/query/registry.go +++ b/service/history/query/registry.go @@ -20,6 +20,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +//go:generate mockgen -package $GOPACKAGE -source $GOFILE -destination registry_mock.go -self_package github.com/uber/cadence/service/history/query + package query import ( diff --git a/service/history/query/registry_mock.go b/service/history/query/registry_mock.go new file mode 100644 index 00000000000..7e94b627d8f --- /dev/null +++ b/service/history/query/registry_mock.go @@ -0,0 +1,256 @@ +// The MIT License (MIT) + +// Copyright (c) 2017-2020 Uber Technologies Inc. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// Code generated by MockGen. DO NOT EDIT. +// Source: registry.go + +// Package query is a generated GoMock package. +package query + +import ( + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + + types "github.com/uber/cadence/common/types" +) + +// MockRegistry is a mock of Registry interface. +type MockRegistry struct { + ctrl *gomock.Controller + recorder *MockRegistryMockRecorder +} + +// MockRegistryMockRecorder is the mock recorder for MockRegistry. +type MockRegistryMockRecorder struct { + mock *MockRegistry +} + +// NewMockRegistry creates a new mock instance. +func NewMockRegistry(ctrl *gomock.Controller) *MockRegistry { + mock := &MockRegistry{ctrl: ctrl} + mock.recorder = &MockRegistryMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRegistry) EXPECT() *MockRegistryMockRecorder { + return m.recorder +} + +// BufferQuery mocks base method. +func (m *MockRegistry) BufferQuery(queryInput *types.WorkflowQuery) (string, <-chan struct{}) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BufferQuery", queryInput) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(<-chan struct{}) + return ret0, ret1 +} + +// BufferQuery indicates an expected call of BufferQuery. +func (mr *MockRegistryMockRecorder) BufferQuery(queryInput interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BufferQuery", reflect.TypeOf((*MockRegistry)(nil).BufferQuery), queryInput) +} + +// GetBufferedIDs mocks base method. +func (m *MockRegistry) GetBufferedIDs() []string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBufferedIDs") + ret0, _ := ret[0].([]string) + return ret0 +} + +// GetBufferedIDs indicates an expected call of GetBufferedIDs. +func (mr *MockRegistryMockRecorder) GetBufferedIDs() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBufferedIDs", reflect.TypeOf((*MockRegistry)(nil).GetBufferedIDs)) +} + +// GetCompletedIDs mocks base method. +func (m *MockRegistry) GetCompletedIDs() []string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCompletedIDs") + ret0, _ := ret[0].([]string) + return ret0 +} + +// GetCompletedIDs indicates an expected call of GetCompletedIDs. +func (mr *MockRegistryMockRecorder) GetCompletedIDs() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCompletedIDs", reflect.TypeOf((*MockRegistry)(nil).GetCompletedIDs)) +} + +// GetFailedIDs mocks base method. +func (m *MockRegistry) GetFailedIDs() []string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFailedIDs") + ret0, _ := ret[0].([]string) + return ret0 +} + +// GetFailedIDs indicates an expected call of GetFailedIDs. +func (mr *MockRegistryMockRecorder) GetFailedIDs() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFailedIDs", reflect.TypeOf((*MockRegistry)(nil).GetFailedIDs)) +} + +// GetQueryInput mocks base method. +func (m *MockRegistry) GetQueryInput(arg0 string) (*types.WorkflowQuery, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQueryInput", arg0) + ret0, _ := ret[0].(*types.WorkflowQuery) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQueryInput indicates an expected call of GetQueryInput. +func (mr *MockRegistryMockRecorder) GetQueryInput(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryInput", reflect.TypeOf((*MockRegistry)(nil).GetQueryInput), arg0) +} + +// GetQueryTermCh mocks base method. +func (m *MockRegistry) GetQueryTermCh(arg0 string) (<-chan struct{}, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQueryTermCh", arg0) + ret0, _ := ret[0].(<-chan struct{}) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQueryTermCh indicates an expected call of GetQueryTermCh. +func (mr *MockRegistryMockRecorder) GetQueryTermCh(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryTermCh", reflect.TypeOf((*MockRegistry)(nil).GetQueryTermCh), arg0) +} + +// GetTerminationState mocks base method. +func (m *MockRegistry) GetTerminationState(arg0 string) (*TerminationState, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTerminationState", arg0) + ret0, _ := ret[0].(*TerminationState) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTerminationState indicates an expected call of GetTerminationState. +func (mr *MockRegistryMockRecorder) GetTerminationState(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTerminationState", reflect.TypeOf((*MockRegistry)(nil).GetTerminationState), arg0) +} + +// GetUnblockedIDs mocks base method. +func (m *MockRegistry) GetUnblockedIDs() []string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetUnblockedIDs") + ret0, _ := ret[0].([]string) + return ret0 +} + +// GetUnblockedIDs indicates an expected call of GetUnblockedIDs. +func (mr *MockRegistryMockRecorder) GetUnblockedIDs() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUnblockedIDs", reflect.TypeOf((*MockRegistry)(nil).GetUnblockedIDs)) +} + +// HasBufferedQuery mocks base method. +func (m *MockRegistry) HasBufferedQuery() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasBufferedQuery") + ret0, _ := ret[0].(bool) + return ret0 +} + +// HasBufferedQuery indicates an expected call of HasBufferedQuery. +func (mr *MockRegistryMockRecorder) HasBufferedQuery() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasBufferedQuery", reflect.TypeOf((*MockRegistry)(nil).HasBufferedQuery)) +} + +// HasCompletedQuery mocks base method. +func (m *MockRegistry) HasCompletedQuery() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasCompletedQuery") + ret0, _ := ret[0].(bool) + return ret0 +} + +// HasCompletedQuery indicates an expected call of HasCompletedQuery. +func (mr *MockRegistryMockRecorder) HasCompletedQuery() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasCompletedQuery", reflect.TypeOf((*MockRegistry)(nil).HasCompletedQuery)) +} + +// HasFailedQuery mocks base method. +func (m *MockRegistry) HasFailedQuery() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasFailedQuery") + ret0, _ := ret[0].(bool) + return ret0 +} + +// HasFailedQuery indicates an expected call of HasFailedQuery. +func (mr *MockRegistryMockRecorder) HasFailedQuery() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasFailedQuery", reflect.TypeOf((*MockRegistry)(nil).HasFailedQuery)) +} + +// HasUnblockedQuery mocks base method. +func (m *MockRegistry) HasUnblockedQuery() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasUnblockedQuery") + ret0, _ := ret[0].(bool) + return ret0 +} + +// HasUnblockedQuery indicates an expected call of HasUnblockedQuery. +func (mr *MockRegistryMockRecorder) HasUnblockedQuery() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasUnblockedQuery", reflect.TypeOf((*MockRegistry)(nil).HasUnblockedQuery)) +} + +// RemoveQuery mocks base method. +func (m *MockRegistry) RemoveQuery(id string) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RemoveQuery", id) +} + +// RemoveQuery indicates an expected call of RemoveQuery. +func (mr *MockRegistryMockRecorder) RemoveQuery(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveQuery", reflect.TypeOf((*MockRegistry)(nil).RemoveQuery), id) +} + +// SetTerminationState mocks base method. +func (m *MockRegistry) SetTerminationState(arg0 string, arg1 *TerminationState) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetTerminationState", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetTerminationState indicates an expected call of SetTerminationState. +func (mr *MockRegistryMockRecorder) SetTerminationState(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTerminationState", reflect.TypeOf((*MockRegistry)(nil).SetTerminationState), arg0, arg1) +}