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:
@@ -62,7 +62,7 @@ var _ = Describe("Services", func() {
|
||||
AfterEach(func() {
|
||||
for _, ns := range namespaces {
|
||||
By(fmt.Sprintf("Destroying namespace %v", ns))
|
||||
if err := c.Namespaces().Delete(ns); err != nil {
|
||||
if err := deleteNS(c, ns); err != nil {
|
||||
Failf("Couldn't delete namespace %s: %s", ns, err)
|
||||
}
|
||||
}
|
||||
@@ -1096,6 +1096,14 @@ func validateEndpointsOrFail(c *client.Client, namespace, serviceName string, ex
|
||||
}
|
||||
Logf("Unexpected number of endpoints: found %v, expected %v (%v elapsed, ignoring for 5s)", portsByIp, expectedEndpoints, time.Since(start))
|
||||
}
|
||||
|
||||
if pods, err := c.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything()); err == nil {
|
||||
for _, pod := range pods.Items {
|
||||
Logf("Pod %s\t%s\t%s\t%s", pod.Namespace, pod.Name, pod.Spec.NodeName, pod.DeletionTimestamp)
|
||||
}
|
||||
} else {
|
||||
Logf("Can't list pod debug info: %v", err)
|
||||
}
|
||||
Failf("Timed out waiting for service %s in namespace %s to expose endpoints %v (%v elapsed)", serviceName, namespace, expectedEndpoints, serviceStartTimeout)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user