Merge pull request #125110 from brianpursley/k-125109
Add logging to show which unexpected events were received in kubectl events e2e test
This commit is contained in:
		| @@ -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) | ||||||
| 			} | 			} | ||||||
| 		}) | 		}) | ||||||
| 	}) | 	}) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Kubernetes Prow Robot
					Kubernetes Prow Robot