Use a different seed for random numbers each run
Without this, each run gets the same random numbers so all nodes are racing to remove the deleted node.
This commit is contained in:
1 parent
4d7f0f5014
commit
f5c2f51964
2 files changed
+3
No files matched your search
@@ -354,6 +354,7 @@ func main() {
|
||||
ch := make(chan os.Signal)
|
||||
signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
|
||||
stopCh := make(chan struct{})
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
registerForNodeUpdates(c, stopCh, nodeName, peerName)
|
||||
<-ch
|
||||
close(stopCh)
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"math/rand"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -71,6 +72,7 @@ func doConcurrentIterations(iterations, concurrency int, f func(int)) {
|
||||
}
|
||||
|
||||
func TestPeerListFuzz(t *testing.T) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
const (
|
||||
testIters = 1000
|
||||
maxNodes = 100
|
||||
|
||||
Reference in new issue
Block a user