e2e test cases should clean up more effectively

Graceful deletion exposes weakness in cleanup paths, add
common hooks for waiting for namespcae deletion to complete,
use direct delection where necessary, and add some debug output
for finding cleanup flags (namespaces that aren't fully deleted)
This commit is contained in:
Clayton Coleman
2015-08-07 12:40:59 -04:00
parent 213e7a8ab6
commit e623d33343
5 changed files with 77 additions and 15 deletions

View File

@@ -246,14 +246,11 @@ var _ = Describe("Pods", func() {
}
By("deleting the pod")
podClient.Delete(pod.Name, nil)
pods, err = podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything())
if err != nil {
if err := podClient.Delete(pod.Name, nil); err != nil {
Failf("Failed to delete pod: %v", err)
}
Expect(len(pods.Items)).To(Equal(0))
By("veryfying pod deletion was observed")
By("verifying pod deletion was observed")
deleted := false
timeout := false
timer := time.After(podStartTimeout)
@@ -270,6 +267,12 @@ var _ = Describe("Pods", func() {
if !deleted {
Fail("Failed to observe pod deletion")
}
pods, err = podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything())
if err != nil {
Fail(fmt.Sprintf("Failed to list pods to verify deletion: %v", err))
}
Expect(len(pods.Items)).To(Equal(0))
})
It("should be updated", func() {