Pod deletion observation is flaking, increase timeout and debug more

We can afford to wait longer than 30 seconds, and we should be printing
more error and output information about the cause of the failure.
This commit is contained in:
Clayton Coleman 2017-02-24 14:12:47 -05:00
parent ee88325f81
commit 3f04421d7b
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3

View File

@ -233,18 +233,21 @@ var _ = framework.KubeDescribe("Pods", func() {
By("verifying pod deletion was observed")
deleted := false
timeout := false
var lastPod *v1.Pod
timer := time.After(30 * time.Second)
for !deleted && !timeout {
timer := time.After(2 * time.Minute)
for !deleted {
select {
case event, _ := <-w.ResultChan():
if event.Type == watch.Deleted {
switch event.Type {
case watch.Deleted:
lastPod = event.Object.(*v1.Pod)
deleted = true
case watch.Error:
framework.Logf("received a watch error: %v", event.Object)
Fail("watch closed with error")
}
case <-timer:
timeout = true
Fail("timed out waiting for pod deletion")
}
}
if !deleted {