From 4a6e7b5053b10f3408150f7a4cf5640e5d1fd88b Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Mon, 22 Jun 2015 12:24:00 +0200 Subject: [PATCH 1/3] Don't run 3 pods per node test --- test/e2e/density.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/density.go b/test/e2e/density.go index acb92a79fd0..de730afe234 100644 --- a/test/e2e/density.go +++ b/test/e2e/density.go @@ -158,7 +158,7 @@ var _ = Describe("Density", func() { for _, testArg := range densityTests { name := fmt.Sprintf("should allow starting %d pods per node", testArg.podsPerMinion) - if testArg.podsPerMinion <= 30 { + if testArg.podsPerMinion == 30 { name = "[Performance suite] " + name } if testArg.skip { From 47b6e6a84eff30cec7358beaf014c2392d7d6ff9 Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Mon, 22 Jun 2015 13:47:05 +0200 Subject: [PATCH 2/3] Wait for terminating namespaces deletion --- test/e2e/density.go | 7 +++++++ test/e2e/load.go | 7 +++++++ test/e2e/util.go | 26 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/test/e2e/density.go b/test/e2e/density.go index de730afe234..19ae69f6468 100644 --- a/test/e2e/density.go +++ b/test/e2e/density.go @@ -86,6 +86,13 @@ var _ = Describe("Density", func() { expectNoError(err) minionCount = len(minions.Items) Expect(minionCount).NotTo(BeZero()) + + // Terminating a namespace (deleting the remaining objects from it - which + // generally means events) can affect the current run. Thus we wait for all + // terminating namespace to be finally deleted before starting this test. + err = deleteTestingNS(c) + expectNoError(err) + nsForTesting, err := createTestingNS("density", c) ns = nsForTesting.Name expectNoError(err) diff --git a/test/e2e/load.go b/test/e2e/load.go index dc3b30ac36d..68cbf331463 100644 --- a/test/e2e/load.go +++ b/test/e2e/load.go @@ -63,6 +63,13 @@ var _ = Describe("Load capacity", func() { expectNoError(err) nodeCount = len(nodes.Items) Expect(nodeCount).NotTo(BeZero()) + + // Terminating a namespace (deleting the remaining objects from it - which + // generally means events) can affect the current run. Thus we wait for all + // terminating namespace to be finally deleted before starting this test. + err = deleteTestingNS(c) + expectNoError(err) + nsForTesting, err := createTestingNS("load", c) ns = nsForTesting.Name expectNoError(err) diff --git a/test/e2e/util.go b/test/e2e/util.go index b87823472c1..5c90169fc2c 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -376,6 +376,32 @@ func createTestingNS(baseName string, c *client.Client) (*api.Namespace, error) return got, nil } +// deleteTestingNS checks whether all e2e based existing namespaces are in the Terminating state +// and waits until they are finally deleted. +func deleteTestingNS(c *client.Client) error { + Logf("Waiting for terminating namespaces to be deleted...") + for start := time.Now(); time.Since(start) < 30*time.Minute; time.Sleep(15 * time.Second) { + namespaces, err := c.Namespaces().List(labels.Everything(), fields.Everything()) + if err != nil { + Logf("Listing namespaces failed: %v", err) + continue + } + terminating := 0 + for _, ns := range namespaces.Items { + if strings.HasPrefix(ns.ObjectMeta.Name, "e2e-tests-") { + if ns.Status.Phase == api.NamespaceActive { + return fmt.Errorf("Namespace %s is active", ns) + } + terminating++ + } + } + if terminating == 0 { + return nil + } + } + return fmt.Errorf("Waiting for terminating namespaces to be deleted timed out") +} + func waitForPodRunningInNamespace(c *client.Client, podName string, namespace string) error { return waitForPodCondition(c, namespace, podName, "running", podStartTimeout, func(pod *api.Pod) (bool, error) { if pod.Status.Phase == api.PodRunning { From 5cfa0ceb323715aac5f03c2c67572df278fe0d78 Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Mon, 22 Jun 2015 14:39:30 +0200 Subject: [PATCH 3/3] Enable latency tests as part of Density --- test/e2e/density.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/density.go b/test/e2e/density.go index 19ae69f6468..9455fd50156 100644 --- a/test/e2e/density.go +++ b/test/e2e/density.go @@ -156,7 +156,7 @@ var _ = Describe("Density", func() { // TODO: Reenable once we can measure latency only from a single test. // TODO: Expose runLatencyTest as ginkgo flag. {podsPerMinion: 3, skip: true, runLatencyTest: false, interval: 10 * time.Second}, - {podsPerMinion: 30, skip: true, runLatencyTest: false, interval: 10 * time.Second}, + {podsPerMinion: 30, skip: true, runLatencyTest: true, interval: 10 * time.Second}, // More than 30 pods per node is outside our v1.0 goals. // We might want to enable those tests in the future. {podsPerMinion: 50, skip: true, runLatencyTest: false, interval: 10 * time.Second},