From ca112f872185531d39029d5927dae9a940295cb2 Mon Sep 17 00:00:00 2001 From: "R.B. Boyer" <4903+rboyer@users.noreply.github.com> Date: Thu, 24 Feb 2022 17:35:46 -0600 Subject: [PATCH] fix flaky test panic (#12446) --- agent/consul/leader_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agent/consul/leader_test.go b/agent/consul/leader_test.go index fa03706069..15c9757c36 100644 --- a/agent/consul/leader_test.go +++ b/agent/consul/leader_test.go @@ -156,6 +156,9 @@ func TestLeader_FailedMember(t *testing.T) { if err != nil { r.Fatalf("err: %v", err) } + if len(checks) != 1 { + r.Fatalf("client missing check") + } if got, want := checks[0].Status, api.HealthCritical; got != want { r.Fatalf("got status %q want %q", got, want) } @@ -703,6 +706,9 @@ func TestLeader_Reconcile_Races(t *testing.T) { if err != nil { r.Fatalf("err: %v", err) } + if len(checks) != 1 { + r.Fatalf("client missing check") + } if got, want := checks[0].Status, api.HealthCritical; got != want { r.Fatalf("got state %q want %q", got, want) }