diff --git a/pkg/util/filesystem/util_windows_test.go b/pkg/util/filesystem/util_windows_test.go index 4e87c3ddc22..dc692e4949c 100644 --- a/pkg/util/filesystem/util_windows_test.go +++ b/pkg/util/filesystem/util_windows_test.go @@ -34,7 +34,6 @@ import ( func TestIsUnixDomainSocketPipe(t *testing.T) { generatePipeName := func(suffixLen int) string { - rand.Seed(time.Now().UnixNano()) letter := []rune("abcdef0123456789") b := make([]rune, suffixLen) for i := range b { diff --git a/staging/src/k8s.io/client-go/tools/cache/main_test.go b/staging/src/k8s.io/client-go/tools/cache/main_test.go index 16933a4b530..abbfb0b506a 100644 --- a/staging/src/k8s.io/client-go/tools/cache/main_test.go +++ b/staging/src/k8s.io/client-go/tools/cache/main_test.go @@ -17,13 +17,10 @@ limitations under the License. package cache import ( - "math/rand" "os" "testing" - "time" ) func TestMain(m *testing.M) { - rand.Seed(time.Now().UnixNano()) os.Exit(m.Run()) } diff --git a/staging/src/k8s.io/client-go/tools/record/main_test.go b/staging/src/k8s.io/client-go/tools/record/main_test.go index b3c74f25bc7..58f81f74910 100644 --- a/staging/src/k8s.io/client-go/tools/record/main_test.go +++ b/staging/src/k8s.io/client-go/tools/record/main_test.go @@ -17,13 +17,10 @@ limitations under the License. package record import ( - "math/rand" "os" "testing" - "time" ) func TestMain(m *testing.M) { - rand.Seed(time.Now().UnixNano()) os.Exit(m.Run()) } diff --git a/staging/src/k8s.io/client-go/util/workqueue/main_test.go b/staging/src/k8s.io/client-go/util/workqueue/main_test.go index 41274b2c251..04d5817e4c4 100644 --- a/staging/src/k8s.io/client-go/util/workqueue/main_test.go +++ b/staging/src/k8s.io/client-go/util/workqueue/main_test.go @@ -17,13 +17,10 @@ limitations under the License. package workqueue import ( - "math/rand" "os" "testing" - "time" ) func TestMain(m *testing.M) { - rand.Seed(time.Now().UnixNano()) os.Exit(m.Run()) } diff --git a/staging/src/k8s.io/component-base/cli/run.go b/staging/src/k8s.io/component-base/cli/run.go index c72b303e2dc..d62a66b61b2 100644 --- a/staging/src/k8s.io/component-base/cli/run.go +++ b/staging/src/k8s.io/component-base/cli/run.go @@ -18,9 +18,7 @@ package cli import ( "fmt" - "math/rand" "os" - "time" "github.com/spf13/cobra" @@ -86,7 +84,6 @@ func RunNoErrOutput(cmd *cobra.Command) error { } func run(cmd *cobra.Command) (logsInitialized bool, err error) { - rand.Seed(time.Now().UnixNano()) defer logs.FlushLogs() cmd.SetGlobalNormalizationFunc(cliflag.WordSepNormalizeFunc) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 6c2d342e736..9b1c7ffc18c 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -19,11 +19,9 @@ package e2e import ( "flag" "fmt" - "math/rand" "os" "path/filepath" "testing" - "time" "github.com/onsi/ginkgo/v2" "gopkg.in/yaml.v2" @@ -142,7 +140,6 @@ func TestMain(m *testing.M) { testfiles.AddFileSource(testfiles.RootFileSource{Root: framework.TestContext.RepoRoot}) } - rand.Seed(time.Now().UnixNano()) os.Exit(m.Run()) } diff --git a/test/e2e_node/e2e_node_suite_test.go b/test/e2e_node/e2e_node_suite_test.go index cd559b1b97c..dd08621f3ea 100644 --- a/test/e2e_node/e2e_node_suite_test.go +++ b/test/e2e_node/e2e_node_suite_test.go @@ -28,7 +28,6 @@ import ( "flag" "fmt" - "math/rand" "os" "os/exec" "syscall" @@ -133,7 +132,6 @@ func TestMain(m *testing.M) { // into TestContext. // TODO(pohly): remove RegisterNodeFlags from test_context.go enable Viper config support here? - rand.Seed(time.Now().UnixNano()) pflag.Parse() if pflag.CommandLine.NArg() > 0 { fmt.Fprintf(os.Stderr, "unknown additional command line arguments: %s", pflag.CommandLine.Args()) diff --git a/test/e2e_node/remote/run_remote_suite.go b/test/e2e_node/remote/run_remote_suite.go index 286922122c7..c44853beae2 100644 --- a/test/e2e_node/remote/run_remote_suite.go +++ b/test/e2e_node/remote/run_remote_suite.go @@ -20,13 +20,11 @@ import ( "flag" "fmt" "log" - "math/rand" "os" "os/exec" "os/signal" "strings" "sync" - "time" "k8s.io/klog/v2" ) @@ -77,7 +75,6 @@ func RunRemoteTestSuite(testSuite TestSuite) { os.Exit(1) }() - rand.Seed(time.Now().UnixNano()) if *buildOnly { // Build the archive and exit CreateTestArchive(testSuite, diff --git a/test/integration/volume/main_test.go b/test/integration/volume/main_test.go index 710261d23ca..f3c945d05c6 100644 --- a/test/integration/volume/main_test.go +++ b/test/integration/volume/main_test.go @@ -17,14 +17,11 @@ 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) }