Merge pull request #24466 from wojtek-t/fix_scheduler_benchmark

Automatic merge from submit-queue

Improve script for running scheduler benchmarks

Without this change, this script didn't work in my environment - it's making more consistent with other scripts.

@hongchaodeng @xiang90
This commit is contained in:
k8s-merge-robot 2016-04-19 08:43:50 -07:00
commit 4638f2f355

View File

@ -18,13 +18,16 @@ set -o errexit
set -o nounset
set -o pipefail
pushd "../../../.."
source "./hack/lib/util.sh"
source "./cluster/lib/logging.sh"
source "./hack/lib/etcd.sh"
popd
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../../../..
source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
DIR_BASENAME=$(dirname "${BASH_SOURCE}")
pushd ${DIR_BASENAME}
cleanup() {
popd 2> /dev/null
kube::etcd::cleanup
kube::log::status "performance test cleanup complete"
}
@ -34,13 +37,13 @@ trap cleanup EXIT
kube::etcd::start
kube::log::status "performance test start"
# TODO: set log-dir and prof output dir.
DIR_BASENAME=$(basename `pwd`)
go test -c -o "${DIR_BASENAME}.test"
# We are using the benchmark suite to do profiling. Because it only runs a few pods and
# theoretically it has less variance.
"./${DIR_BASENAME}.test" -test.bench=. -test.run=xxxx -test.cpuprofile=prof.out -logtostderr=false
if ${RUN_BENCHMARK:-false}; then
go test -c -o "perf.test"
"./perf.test" -test.bench=. -test.run=xxxx -test.cpuprofile=prof.out
fi
kube::log::status "benchmark tests finished"
# Running density tests. It might take a long time.
"./${DIR_BASENAME}.test" -test.run=. -test.timeout=60m
go test -test.run=. -test.timeout=60m
kube::log::status "density tests finished"