diff --git a/test/integration/scheduler_perf/test-performance.sh b/test/integration/scheduler_perf/test-performance.sh index 7eb6aba0301..472939d5cb4 100755 --- a/test/integration/scheduler_perf/test-performance.sh +++ b/test/integration/scheduler_perf/test-performance.sh @@ -18,7 +18,7 @@ set -o errexit set -o nounset set -o pipefail -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../../../.. +KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../../../ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env @@ -35,15 +35,18 @@ cleanup() { trap cleanup EXIT kube::etcd::start -kube::log::status "performance test start" # We are using the benchmark suite to do profiling. Because it only runs a few pods and # theoretically it has less variance. if ${RUN_BENCHMARK:-false}; then + kube::log::status "performance test (benchmark) compiling" go test -c -o "perf.test" + + kube::log::status "performance test (benchmark) start" "./perf.test" -test.bench=. -test.run=xxxx -test.cpuprofile=prof.out -test.short=false - kube::log::status "benchmark tests finished" + kube::log::status "...benchmark tests finished" fi # Running density tests. It might take a long time. +kube::log::status "performance test (density) start" go test -test.run=. -test.timeout=60m -test.short=false -kube::log::status "density tests finished" +kube::log::status "...density tests finished" diff --git a/test/integration/scheduler_perf/util.go b/test/integration/scheduler_perf/util.go index ff40595298d..2ddc65c3f17 100644 --- a/test/integration/scheduler_perf/util.go +++ b/test/integration/scheduler_perf/util.go @@ -27,7 +27,6 @@ import ( "k8s.io/kubernetes/pkg/client/record" "k8s.io/kubernetes/pkg/client/restclient" client "k8s.io/kubernetes/pkg/client/unversioned" - "k8s.io/kubernetes/pkg/master" "k8s.io/kubernetes/pkg/util/workqueue" "k8s.io/kubernetes/plugin/pkg/scheduler" _ "k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider" @@ -44,16 +43,15 @@ import ( // Notes on rate limiter: // - client rate limit is set to 5000. func mustSetupScheduler() (schedulerConfigFactory *factory.ConfigFactory, destroyFunc func()) { - var m *master.Master - masterConfig := framework.NewIntegrationTestMasterConfig() - m, err := masterConfig.Complete().New() - if err != nil { - panic("error in brining up the master: " + err.Error()) - } + + h := &framework.MasterHolder{Initialized: make(chan struct{})} s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - m.GenericAPIServer.Handler.ServeHTTP(w, req) + <-h.Initialized + h.M.GenericAPIServer.Handler.ServeHTTP(w, req) })) + framework.RunAMasterUsingServer(framework.NewIntegrationTestMasterConfig(), s, h) + c := client.NewOrDie(&restclient.Config{ Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: ®istered.GroupOrDie(api.GroupName).GroupVersion}, @@ -62,6 +60,7 @@ func mustSetupScheduler() (schedulerConfigFactory *factory.ConfigFactory, destro }) schedulerConfigFactory = factory.NewConfigFactory(c, api.DefaultSchedulerName, api.DefaultHardPodAffinitySymmetricWeight, api.DefaultFailureDomains) + schedulerConfig, err := schedulerConfigFactory.Create() if err != nil { panic("Couldn't create scheduler config")