Merge pull request #69670 from atlassian/simplify-rand-seed

Simplify rand seeding
This commit is contained in:
k8s-ci-robot
2018-10-15 13:53:01 -07:00
committed by GitHub
22 changed files with 28 additions and 22 deletions

View File

@@ -17,11 +17,14 @@ limitations under the License.
package volume
import (
"math/rand"
"testing"
"time"
"k8s.io/kubernetes/test/integration/framework"
)
func TestMain(m *testing.M) {
rand.Seed(time.Now().UnixNano())
framework.EtcdMain(m.Run)
}

View File

@@ -256,7 +256,6 @@ func TestPersistentVolumeBindRace(t *testing.T) {
glog.V(2).Infof("TestPersistentVolumeBindRace claims created")
// putting a bind manually on a pv should only match the claim it is bound to
rand.Seed(time.Now().Unix())
claim := claims[rand.Intn(maxClaims-1)]
claimRef, err := ref.GetReference(legacyscheme.Scheme, claim)
if err != nil {