forked from quic-go/quic-go
properly initialise the random number generator in the integration tests
This commit is contained in:
@@ -2,7 +2,7 @@ package gquic_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
mrand "math/rand"
|
||||
"math/rand"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
@@ -26,7 +26,7 @@ func TestIntegration(t *testing.T) {
|
||||
}
|
||||
|
||||
var _ = BeforeSuite(func() {
|
||||
mrand.Seed(GinkgoRandomSeed())
|
||||
rand.Seed(GinkgoRandomSeed())
|
||||
})
|
||||
|
||||
var _ = JustBeforeEach(func() {
|
||||
|
||||
@@ -24,7 +24,6 @@ func getRandomDuration(min, max time.Duration) time.Duration {
|
||||
}
|
||||
|
||||
var _ = Describe("Random Duration Generator", func() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
It("gets a random RTT", func() {
|
||||
var min time.Duration = time.Hour
|
||||
var max time.Duration
|
||||
@@ -54,7 +53,6 @@ var _ = Describe("Random RTT", func() {
|
||||
var proxy *quicproxy.QuicProxy
|
||||
|
||||
runRTTTest := func(minRtt, maxRtt time.Duration, version protocol.VersionNumber) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
var err error
|
||||
proxy, err = quicproxy.NewQuicProxy("localhost:", version, &quicproxy.Opts{
|
||||
RemoteAddr: "localhost:" + testserver.Port(),
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
package self_test
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
_ "github.com/lucas-clemente/quic-go/integrationtests/tools/testlog"
|
||||
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSelf(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
RunSpecs(t, "Self integration tests")
|
||||
}
|
||||
|
||||
var _ = BeforeSuite(func() {
|
||||
rand.Seed(GinkgoRandomSeed())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user