Swap all 'crypto/rand' rng in tests with 'math/rand'
This commit is contained in:
parent
9839d64fd8
commit
2acaf71e32
|
@ -1,7 +1,6 @@
|
|||
package backpressure_tests
|
||||
|
||||
import (
|
||||
crand "crypto/rand"
|
||||
"io"
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
@ -15,6 +14,7 @@ import (
|
|||
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
|
||||
|
||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
||||
u "github.com/ipfs/go-ipfs/util"
|
||||
)
|
||||
|
||||
var log = eventlog.Logger("backpressure")
|
||||
|
@ -236,7 +236,7 @@ func TestStBackpressureStreamWrite(t *testing.T) {
|
|||
|
||||
// ready a buffer of random data
|
||||
buf := make([]byte, 65536)
|
||||
crand.Read(buf)
|
||||
u.NewTimeSeededRand().Read(buf)
|
||||
|
||||
for {
|
||||
// send a randomly sized subchunk
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package reconnect
|
||||
|
||||
import (
|
||||
crand "crypto/rand"
|
||||
"io"
|
||||
"math/rand"
|
||||
"sync"
|
||||
|
@ -14,6 +13,7 @@ import (
|
|||
protocol "github.com/ipfs/go-ipfs/p2p/protocol"
|
||||
testutil "github.com/ipfs/go-ipfs/p2p/test/util"
|
||||
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
|
||||
u "github.com/ipfs/go-ipfs/util"
|
||||
|
||||
ps "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-peerstream"
|
||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
||||
|
@ -66,7 +66,7 @@ func newSender() (chan sendChans, func(s inet.Stream)) {
|
|||
|
||||
buf := make([]byte, 65536)
|
||||
buf2 := make([]byte, 65536)
|
||||
crand.Read(buf)
|
||||
u.NewTimeSeededRand().Read(buf)
|
||||
|
||||
for {
|
||||
select {
|
||||
|
|
Loading…
Reference in New Issue