Skip to content

Commit

Permalink
修复data race
Browse files Browse the repository at this point in the history
  • Loading branch information
juniaoshaonian committed Oct 19, 2023
1 parent 4eb1b92 commit f9551eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion e2e/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,10 @@ func (b *TestSuite) TestMQConsumer_Consume() {
err = c.Close()
require.NoError(b.T(), err)
time.Sleep(5 * time.Second)
assert.ElementsMatch(b.T(), wantVal, genMsg(ans, false))
locker.Lock()
val := ans
locker.Unlock()
assert.ElementsMatch(b.T(), wantVal, genMsg(val, false))
}

func genMsg(msgs []*mq.Message, hasPartitionID bool) []*mq.Message {
Expand Down

0 comments on commit f9551eb

Please sign in to comment.