Skip to content

Commit

Permalink
refactor(storagenode): do not use deprecated global rand seed
Browse files Browse the repository at this point in the history
  • Loading branch information
ijsong committed Apr 5, 2023
1 parent 3d62738 commit b167c5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/storagenode/executorsmap/executors_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,16 @@ func TestExecutorsMapOrdred(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

rand.Seed(time.Now().UnixNano())
rng := rand.New(rand.NewSource(time.Now().UnixNano()))

emap := New(numExtors)
lstpMap := make(map[types.LogStreamID]types.TopicID)

var stored [numExtors]bool
for i := 0; i < numExtors*10; i++ {
pos := rand.Intn(numExtors)
pos := rng.Intn(numExtors)
lsid := types.LogStreamID(pos)
tpid := types.TopicID(rand.Int31())
tpid := types.TopicID(rng.Int31())
if _, ok := lstpMap[lsid]; ok {
tpid = lstpMap[lsid]
} else {
Expand Down

0 comments on commit b167c5b

Please sign in to comment.