Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests: Migrate scheduler perf to the integration suite, s… #32520

Merged
merged 1 commit into from Sep 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion hack/make-rules/test-integration.sh
Expand Up @@ -42,6 +42,7 @@ kube::test::find_integration_test_dirs() {
cd ${KUBE_ROOT}
find test/integration/${1-} -name '*_test.go' -print0 \
| xargs -0n1 dirname \
| uniq \
| sort -u
)
}
Expand All @@ -61,7 +62,7 @@ runTests() {
# KUBE_RACE="-race"
make -C "${KUBE_ROOT}" test \
WHAT="$(kube::test::find_integration_test_dirs ${2-} | paste -sd' ' -)" \
KUBE_GOFLAGS="${KUBE_GOFLAGS:-} -tags 'integration no-docker'" \
KUBE_GOFLAGS="${KUBE_GOFLAGS:-} -short=true -tags 'integration no-docker'" \
KUBE_TEST_ARGS="${KUBE_TEST_ARGS:-} --vmodule=garbage*collector*=6 --alsologtostderr=true" \
KUBE_RACE="" \
KUBE_TIMEOUT="${KUBE_TIMEOUT}" \
Expand Down
14 changes: 11 additions & 3 deletions test/integration/framework/etcd_utils.go
Expand Up @@ -30,9 +30,8 @@ import (
// If you need to start an etcd instance by hand, you also need to insert a key
// for this check to pass (*any* key will do, eg:
//curl -L http://127.0.0.1:2379/v2/keys/message -XPUT -d value="Hello world").
func init() {
RequireEtcd()
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I realized that I don't understand why you are removing this init() function. Can you please explain? [What you did seems more complicated.]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wojtek-t replied below... removing init() so that t.Skip(..) works. The broader reason to remove it is in the comment below.

var testing_etcd = false

func GetEtcdURLFromEnv() string {
url := env.GetEnvAsStringOrFallback("KUBE_INTEGRATION_ETCD_URL", "http://127.0.0.1:2379")
Expand All @@ -41,6 +40,10 @@ func GetEtcdURLFromEnv() string {
}

func NewEtcdClient() etcd.Client {
// gaurded to avoid infinite recursion, check etcd.
if testing_etcd {
RequireEtcd()
}
cfg := etcd.Config{
Endpoints: []string{GetEtcdURLFromEnv()},
}
Expand All @@ -52,9 +55,14 @@ func NewEtcdClient() etcd.Client {
}

func RequireEtcd() {
testing_etcd = true
defer func() {
testing_etcd = false
}()
if _, err := etcd.NewKeysAPI(NewEtcdClient()).Get(context.TODO(), "/", nil); err != nil {
glog.Fatalf("unable to connect to etcd for testing: %v", err)
}

}

func WithEtcdKey(f func(string)) {
Expand Down
Expand Up @@ -73,3 +73,6 @@ cd kubernetes/test/component/scheduler/perf
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/test/component/scheduler/perf/README.md?pixel)]()
<!-- END MUNGE: GENERATED_ANALYTICS -->


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/test/integration/scheduler_perf/README.md?pixel)]()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unneded to me.

Expand Up @@ -24,11 +24,17 @@ import (

// TestSchedule100Node3KPods schedules 3k pods on 100 nodes.
func TestSchedule100Node3KPods(t *testing.T) {
if testing.Short() {
t.Skip("Skipping because we want to run short tests")
}
schedulePods(100, 3000)
}

// TestSchedule1000Node30KPods schedules 30k pods on 1000 nodes.
func TestSchedule1000Node30KPods(t *testing.T) {
if testing.Short() {
t.Skip("Skipping because we want to run short tests")
}
schedulePods(1000, 30000)
}

Expand Down
Expand Up @@ -41,9 +41,9 @@ kube::log::status "performance test start"
# theoretically it has less variance.
if ${RUN_BENCHMARK:-false}; then
go test -c -o "perf.test"
"./perf.test" -test.bench=. -test.run=xxxx -test.cpuprofile=prof.out
"./perf.test" -test.bench=. -test.run=xxxx -test.cpuprofile=prof.out -test.short=false
kube::log::status "benchmark tests finished"
fi
# Running density tests. It might take a long time.
go test -test.run=. -test.timeout=60m
go test -test.run=. -test.timeout=60m -test.short=false
kube::log::status "density tests finished"
Expand Up @@ -44,7 +44,7 @@ import (
// Notes on rate limiter:
// - client rate limit is set to 5000.
func mustSetupScheduler() (schedulerConfigFactory *factory.ConfigFactory, destroyFunc func()) {
framework.DeleteAllEtcdKeys()
// framework.DeleteAllEtcdKeys()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did this get commented out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to disable for compilation. I considered deleting it but, clearly it was originally there for some purpose. Once these are working again we can determine wether or not we want to re-enable etcd deletion. As of now, a new etc instance that would typically get started by the test wrapper makes this line not necessary unless running on a persistent instance

Copy link
Member

@ixdy ixdy Sep 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment explaining why it's commented out / under what conditions it should get uncommented? otherwise 3 months from now we're not going to understand why it's there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure we can simply remove it.


var m *master.Master
masterConfig := framework.NewIntegrationTestMasterConfig()
Expand Down