diff --git a/test/integration/framework/etcd.go b/test/integration/framework/etcd.go index aa1d36a86ab..e7c95570615 100644 --- a/test/integration/framework/etcd.go +++ b/test/integration/framework/etcd.go @@ -18,6 +18,7 @@ package framework import ( "context" + "flag" "fmt" "io/ioutil" "net" @@ -168,6 +169,9 @@ func RunCustomEtcd(dataDir string, customFlags []string) (url string, stopFn fun // EtcdMain starts an etcd instance before running tests. func EtcdMain(tests func() int) { + // Bail out early when -help was given as parameter. + flag.Parse() + stop, err := startEtcd() if err != nil { klog.Fatalf("cannot run integration tests: unable to start etcd: %v", err) diff --git a/test/integration/scheduler_perf/main_test.go b/test/integration/scheduler_perf/main_test.go index 5abe66a8f8a..16275396eba 100644 --- a/test/integration/scheduler_perf/main_test.go +++ b/test/integration/scheduler_perf/main_test.go @@ -17,13 +17,11 @@ limitations under the License. package benchmark import ( - "flag" "testing" "k8s.io/kubernetes/test/integration/framework" ) func TestMain(m *testing.M) { - flag.Parse() framework.EtcdMain(m.Run) }