Fix undeterministic healthcheck unit test coverage, for real (#6542)

Followup to #6496

A test was added in #6496 in `healthckeck_test.go` to ensure the
`validateControlPlanePods` function was fully covered on every run, but
it was actually bailing out early because the `linkerd-destination` and
`linkerd-identity` were not included in the list of pods passed.
This commit is contained in:
Alejandro Pedraza 2021-07-23 10:12:44 -05:00 committed by GitHub
parent b8c0c74da1
commit b7fba54729
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1463,8 +1463,10 @@ func TestValidateControlPlanePods(t *testing.T) {
}) })
// This test is just for ensuring full coverage of the validateControlPlanePods function // This test is just for ensuring full coverage of the validateControlPlanePods function
t.Run("Returns an error if the only pod is not ready", func(t *testing.T) { t.Run("Returns an error if all the controller pods are not ready", func(t *testing.T) {
pods := []corev1.Pod{ pods := []corev1.Pod{
pod("linkerd-destination-9849948665-37082", corev1.PodRunning, false),
pod("linkerd-identity-6849948664-27982", corev1.PodRunning, false),
pod("linkerd-proxy-injector-5f79ff4844-", corev1.PodRunning, false), pod("linkerd-proxy-injector-5f79ff4844-", corev1.PodRunning, false),
} }