Skip to content

Commit

Permalink
Address data race in task processor test (#5807)
Browse files Browse the repository at this point in the history
  • Loading branch information
taylanisikdemir authored Mar 21, 2024
1 parent 12f9a25 commit 857b007
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions service/history/task/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ func (s *queueTaskProcessorSuite) TestGetOrCreateShardTaskScheduler_ProcessorNot

func (s *queueTaskProcessorSuite) TestGetOrCreateShardTaskScheduler_ShardProcessorAlreadyExists() {
mockScheduler := task.NewMockScheduler(s.controller)
mockScheduler.EXPECT().Stop().Times(1)
s.processor.shardSchedulers[s.mockShard] = mockScheduler

s.processor.Start()
defer s.processor.Stop()
scheduler, err := s.processor.getOrCreateShardTaskScheduler(s.mockShard)
s.NoError(err)
s.Equal(mockScheduler, scheduler)
Expand All @@ -116,6 +118,7 @@ func (s *queueTaskProcessorSuite) TestGetOrCreateShardTaskScheduler_ShardProcess
s.Empty(s.processor.shardSchedulers)

s.processor.Start()
defer s.processor.Stop()
scheduler, err := s.processor.getOrCreateShardTaskScheduler(s.mockShard)
s.NoError(err)

Expand Down

0 comments on commit 857b007

Please sign in to comment.