From 7bfc7afef07e7ce8d3453538c7acdf6883b7461c Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Tue, 9 Aug 2022 14:50:40 -0400 Subject: [PATCH] Minor style changes to test logic --- queue/queue_test.go | 10 +++++----- store/store_test.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/queue/queue_test.go b/queue/queue_test.go index 8ead5665..980efe80 100644 --- a/queue/queue_test.go +++ b/queue/queue_test.go @@ -102,13 +102,13 @@ func Test_MergeQueuedStatements(t *testing.T) { t.Fatalf("statements don't match for test %d", i) } if len(r.flushChans) != len(tt.exp.flushChans) { - for i := range r.flushChans { - if r.flushChans[i] != tt.exp.flushChans[i] { - t.Errorf("wrong channel for test %d", i) - } - } t.Fatalf("incorrect number of flush channels for test %d", i) } + for i := range r.flushChans { + if r.flushChans[i] != tt.exp.flushChans[i] { + t.Fatalf("wrong channel for test %d", i) + } + } } } diff --git a/store/store_test.go b/store/store_test.go index 6abf19e2..bf8445a9 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -1260,15 +1260,15 @@ func Test_MultiNodeStoreNotifyBootstrap(t *testing.T) { if leader0 == leader1 && leader0 == leader2 { return + } else { + t.Fatalf("leader not the same on each node") } // Calling Notify() on a node that is part of a cluster should // be a no-op. if err := s0.Notify(s1.ID(), ln1.Addr().String()); err != nil { - t.Errorf("failed to notify store that is part of cluster: %s", err.Error()) + t.Fatalf("failed to notify store that is part of cluster: %s", err.Error()) } - - t.Fatalf("leader not the same on each node") } func Test_MultiNodeJoinNonVoterRemove(t *testing.T) {