Skip to content

Commit

Permalink
Fix errcheck in service/history
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSnowden committed Dec 23, 2022
1 parent ba2d711 commit 827368b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions service/history/queues/queue_base_test.go
Expand Up @@ -295,7 +295,7 @@ func (s *queueBaseSuite) TestStartStop() {

s.mockRescheduler.EXPECT().Start().Times(1)
base.Start()
base.processNewRange()
s.NoError(base.processNewRange())

<-doneCh
<-base.checkpointTimer.C
Expand Down Expand Up @@ -344,7 +344,7 @@ func (s *queueBaseSuite) TestProcessNewRange() {
)
s.True(base.nonReadableScope.Range.Equals(NewRange(tasks.MinimumKey, tasks.MaximumKey)))

base.processNewRange()
s.NoError(base.processNewRange())
defaultReader, ok := base.readerGroup.ReaderByID(DefaultReaderId)
s.True(ok)
scopes := defaultReader.Scopes()
Expand Down
8 changes: 6 additions & 2 deletions service/history/queues/queue_immediate.go
Expand Up @@ -157,7 +157,9 @@ func (p *immediateQueue) processEventLoop() {
case <-p.shutdownCh:
return
case <-p.notifyCh:
p.processNewRange()
if err := p.processNewRange(); err != nil {
p.logger.Error("Unable to process new range", tag.Error(err))
}
case <-pollTimer.C:
p.processPollTimer(pollTimer)
case <-p.checkpointTimer.C:
Expand All @@ -169,7 +171,9 @@ func (p *immediateQueue) processEventLoop() {
}

func (p *immediateQueue) processPollTimer(pollTimer *time.Timer) {
p.processNewRange()
if err := p.processNewRange(); err != nil {
p.logger.Error("Unable to process new range", tag.Error(err))
}

pollTimer.Reset(backoff.JitDuration(
p.options.MaxPollInterval(),
Expand Down
4 changes: 2 additions & 2 deletions service/history/workflowTaskHandlerCallbacks_test.go
Expand Up @@ -197,10 +197,10 @@ func (s *WorkflowTaskHandlerCallbackSuite) TestVerifyFirstWorkflowTaskScheduled_
}, "wType", "testTaskQueue", payloads.EncodeString("input"), 25*time.Second, 20*time.Second, 200*time.Second, "identity")

// zombie state should be treated as open
ms.UpdateWorkflowStateStatus(
s.NoError(ms.UpdateWorkflowStateStatus(
enumsspb.WORKFLOW_EXECUTION_STATE_ZOMBIE,
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
)
))
wfMs := workflow.TestCloneToProto(ms)
gwmsResponse := &persistence.GetWorkflowExecutionResponse{State: wfMs}
s.mockExecutionMgr.EXPECT().GetWorkflowExecution(gomock.Any(), gomock.Any()).Return(gwmsResponse, nil)
Expand Down

0 comments on commit 827368b

Please sign in to comment.