mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Add logging to show which unexpected events were received in kubectl events e2e test
Co-authored-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>
This commit is contained in:
parent
8339711e1f
commit
39d24b0877
@ -2008,13 +2008,13 @@ metadata:
|
|||||||
// replace multi spaces into single white space
|
// replace multi spaces into single white space
|
||||||
eventsStr := strings.Join(strings.Fields(strings.TrimSpace(events)), " ")
|
eventsStr := strings.Join(strings.Fields(strings.TrimSpace(events)), " ")
|
||||||
if !strings.Contains(string(eventsStr), fmt.Sprintf("Normal Scheduled Pod/%s", podName)) {
|
if !strings.Contains(string(eventsStr), fmt.Sprintf("Normal Scheduled Pod/%s", podName)) {
|
||||||
framework.Failf("failed to list expected event")
|
framework.Failf("failed to list expected event with pod name: %s, got: %s", podName, events)
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.By("expect not showing any WARNING message except timeouts")
|
ginkgo.By("expect not showing any WARNING message except timeouts")
|
||||||
events = e2ekubectl.RunKubectlOrDie(ns, "events", "--types=WARNING", "--for=pod/"+podName)
|
events = e2ekubectl.RunKubectlOrDie(ns, "events", "--types=WARNING", "--for=pod/"+podName)
|
||||||
if events != "" && !strings.Contains(events, "timed out") {
|
if events != "" && !strings.Contains(events, "timed out") {
|
||||||
framework.Failf("unexpected WARNING event fired")
|
framework.Failf("unexpected non-timeout WARNING event fired, got: %s ", events)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user