From 3c9a9a4fb035bdd8cc10bbd035ffcac0d46afa4c Mon Sep 17 00:00:00 2001 From: Robert Rati Date: Thu, 12 Mar 2015 12:29:00 -0400 Subject: [PATCH] Fixed issue with the density test failing after a successful run because of a failure to cleanup #5385 --- test/e2e/density.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/e2e/density.go b/test/e2e/density.go index b49c9773356..cb07865135f 100644 --- a/test/e2e/density.go +++ b/test/e2e/density.go @@ -187,8 +187,14 @@ var _ = PDescribe("Density", func() { }) AfterEach(func() { - // Remove any remaining pods from this test - DeleteRC(c, ns, RCName) + // Remove any remaining pods from this test if the + // replication controller still exists and the replica count + // isn't 0. This means the controller wasn't cleaned up + // during the test so clean it up here + rc, err := c.ReplicationControllers(ns).Get(RCName) + if err == nil && rc.Spec.Replicas != 0 { + DeleteRC(c, ns, RCName) + } }) It("should allow starting 100 pods per node", func() {