Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-li committed Jul 10, 2023
1 parent 2797704 commit aa74fde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/count/counters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import (
"github.com/scylladb/gemini/pkg/count"
)

var rnd = rand.New(rand.NewSource(uint64(time.Now().Unix())))

func TestSimpleCounters(t *testing.T) {
t.Parallel()
countersInfo := []count.Info{{
Expand Down Expand Up @@ -106,6 +104,7 @@ func TestTotalCounters(t *testing.T) {

func scOperations(counters count.SimpleCounters, adds int) {
cl := len(counters)
rnd := rand.New(rand.NewSource(uint64(time.Now().Unix())))
for c := 0; c < adds; c++ {
counters[rnd.Intn(cl)].Inc()
counters[rnd.Intn(cl)].Get()
Expand All @@ -122,6 +121,7 @@ func getSimpleCounterSum(counters count.SimpleCounters) int {

func totalCounterOperations(counters count.TotalCounters, adds int) {
cl := len(counters)
rnd := rand.New(rand.NewSource(uint64(time.Now().Unix())))
for c := 0; c < adds; c++ {
n := rnd.Intn(10)
counters[rnd.Intn(cl)].Inc(n)
Expand Down

0 comments on commit aa74fde

Please sign in to comment.