Skip to content

Commit

Permalink
feat: fix TestNewStreamCopy's data race
Browse files Browse the repository at this point in the history
  • Loading branch information
BytePender committed Dec 13, 2024
1 parent 5828188 commit 36cf3d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion schema/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,10 @@ func TestNewStreamCopy(t *testing.T) {

wgEven.Wait()
memo := copies[0].csr.parent.mem
assert.Equal(t, m/2, memo.closedNum)
memo.mu.Lock()
closedNum := memo.closedNum
memo.mu.Unlock()
assert.Equal(t, m/2, closedNum)

wg.Wait()
assert.Equal(t, m, memo.closedNum)
Expand Down

0 comments on commit 36cf3d5

Please sign in to comment.