Skip to content

Commit c6977ba

Browse files
committed
Merge pull request #192 from arschles/rand-seed
fix(tests_suite_test.go): seed the rng, use true random numbers for users, passwords and emails
2 parents abb339e + 254ff10 commit c6977ba

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

_tests/tests_suite_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os/user"
1010
"path"
1111
"testing"
12+
"time"
1213

1314
. "github.com/onsi/ginkgo"
1415
. "github.com/onsi/ginkgo/config"
@@ -23,7 +24,7 @@ const (
2324
)
2425

2526
func init() {
26-
rand.Seed(GinkgoConfig.RandomSeed)
27+
rand.Seed(time.Now().UnixNano())
2728
}
2829

2930
func getRandAppName() string {
@@ -36,12 +37,13 @@ func TestTests(t *testing.T) {
3637
}
3738

3839
var (
39-
testAdminUser = fmt.Sprintf("test-admin-%d", GinkgoConfig.RandomSeed)
40+
randSuffix = rand.Intn(1000)
41+
testAdminUser = fmt.Sprintf("test-admin-%d", randSuffix)
4042
testAdminPassword = "asdf1234"
41-
testAdminEmail = fmt.Sprintf("test-admin-%d@deis.io", GinkgoConfig.RandomSeed)
42-
testUser = fmt.Sprintf("test-%d", GinkgoConfig.RandomSeed)
43+
testAdminEmail = fmt.Sprintf("test-admin-%d@deis.io", randSuffix)
44+
testUser = fmt.Sprintf("test-%d", randSuffix)
4345
testPassword = "asdf1234"
44-
testEmail = fmt.Sprintf("test-%d@deis.io", GinkgoConfig.RandomSeed)
46+
testEmail = fmt.Sprintf("test-%d@deis.io", randSuffix)
4547
url = getController()
4648
)
4749

0 commit comments

Comments
 (0)