chore: coding style (#3959)

This commit is contained in:
Kevin Wan
2024-03-02 22:45:24 +08:00
committed by GitHub
parent e08ba2fee8
commit 45be48a4ee
10 changed files with 23 additions and 12 deletions

View File

@@ -13,7 +13,7 @@ import (
)
func FuzzMapReduce(f *testing.F) {
rand.Seed(time.Now().UnixNano())
rand.NewSource(time.Now().UnixNano())
f.Add(int64(10), runtime.NumCPU())
f.Fuzz(func(t *testing.T, n int64, workers int) {

View File

@@ -20,7 +20,7 @@ import (
// If Fuzz stuck, we don't know why, because it only returns hung or unexpected,
// so we need to simulate the fuzz test in test mode.
func TestMapReduceRandom(t *testing.T) {
rand.Seed(time.Now().UnixNano())
rand.NewSource(time.Now().UnixNano())
const (
times = 10000

View File

@@ -41,7 +41,7 @@ type RedisLock struct {
}
func init() {
rand.Seed(time.Now().UnixNano())
rand.NewSource(time.Now().UnixNano())
}
// NewRedisLock returns a RedisLock.

View File

@@ -11,7 +11,7 @@ import (
)
func FuzzNodeFind(f *testing.F) {
rand.Seed(time.Now().UnixNano())
rand.NewSource(time.Now().UnixNano())
f.Add(10)
f.Fuzz(func(t *testing.T, keys int) {

View File

@@ -12,7 +12,7 @@ import (
func TestStableRunner(t *testing.T) {
size := bufSize * 2
rand.Seed(time.Now().UnixNano())
rand.NewSource(time.Now().UnixNano())
runner := NewStableRunner(func(v int) float64 {
if v == 0 {
time.Sleep(time.Millisecond * 100)
@@ -49,7 +49,7 @@ func TestStableRunner(t *testing.T) {
}
func FuzzStableRunner(f *testing.F) {
rand.Seed(time.Now().UnixNano())
rand.NewSource(time.Now().UnixNano())
f.Add(uint64(bufSize))
f.Fuzz(func(t *testing.T, n uint64) {
runner := NewStableRunner(func(v int) float64 {