From 99983469e40be64cbfdf754d46934f6169d2c849 Mon Sep 17 00:00:00 2001 From: Nathan VanBenschoten Date: Tue, 6 Sep 2022 12:48:05 -0400 Subject: [PATCH] server: mark testDrainContext assertion methods as test helpers The error messages in cases like #86974 are not useful otherwise. This change allows us to see where the assertion method was called from. Release justification: testing only. --- pkg/server/drain_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/server/drain_test.go b/pkg/server/drain_test.go index 4c855532f7ab..27bc8b02e1dc 100644 --- a/pkg/server/drain_test.go +++ b/pkg/server/drain_test.go @@ -246,18 +246,21 @@ func (t *testDrainContext) sendShutdown() *serverpb.DrainResponse { } func (t *testDrainContext) assertDraining(resp *serverpb.DrainResponse, drain bool) { + t.Helper() if resp.IsDraining != drain { t.Fatalf("expected draining %v, got %v", drain, resp.IsDraining) } } func (t *testDrainContext) assertRemaining(resp *serverpb.DrainResponse, remaining bool) { + t.Helper() if actualRemaining := (resp.DrainRemainingIndicator > 0); remaining != actualRemaining { t.Fatalf("expected remaining %v, got %v", remaining, actualRemaining) } } func (t *testDrainContext) assertEqual(expected int, actual int) { + t.Helper() if expected == actual { return }