Skip to content

Commit

Permalink
Merge 26e2bfd into b549227
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovic committed Oct 21, 2019
2 parents b549227 + 26e2bfd commit 66de078
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/clustering_test.go
Expand Up @@ -86,7 +86,7 @@ func getTestDefaultOptsForClustering(id string, bootstrap bool) *Options {
// IDs, make sure that if someone adds a test with a new ID
// he/she adds it to the list of database names to create on
// test startup.
ok := false
var ok bool
suffix := "_" + id
for _, n := range testDBSuffixes {
if suffix == n {
Expand Down Expand Up @@ -152,6 +152,7 @@ func verifyNoLeader(t *testing.T, timeout time.Duration, servers ...*StanServer)
deadline := time.Now().Add(timeout)
var leader *StanServer
for time.Now().Before(deadline) {
leader = nil
for _, server := range servers {
if server.raft == nil {
continue
Expand All @@ -162,7 +163,9 @@ func verifyNoLeader(t *testing.T, timeout time.Duration, servers ...*StanServer)
break
}
}
return
if leader == nil {
return
}
}
stackFatalf(t, "Found unexpected leader %q", leader.info.NodeID)
}
Expand Down
2 changes: 2 additions & 0 deletions server/server_test.go
Expand Up @@ -186,6 +186,8 @@ func init() {
func stackFatalf(t tLogger, f string, args ...interface{}) {
msg := fmt.Sprintf(f, args...) + "\n" + stack()
t.Fatalf(msg)
// For staticcheck SA0511...
panic("unreachable code")
}

func stack() string {
Expand Down
2 changes: 2 additions & 0 deletions stores/common_test.go
Expand Up @@ -100,6 +100,8 @@ func stackFatalf(t tLogger, f string, args ...interface{}) {
}

t.Fatalf("%s", strings.Join(lines, "\n"))
// For staticcheck SA0511...
panic("unreachable code")
}

func msgStoreLookup(t tLogger, ms MsgStore, seq uint64) *pb.MsgProto {
Expand Down
2 changes: 2 additions & 0 deletions test/test.go
Expand Up @@ -42,4 +42,6 @@ func StackFatalf(t TLogger, f string, args ...interface{}) {
}

t.Fatalf("%s", strings.Join(lines, "\n"))
// For staticcheck SA0511...
panic("unreachable code")
}
2 changes: 2 additions & 0 deletions util/util_test.go
Expand Up @@ -46,6 +46,8 @@ func stackFatalf(t *testing.T, f string, args ...interface{}) {
}

t.Fatalf("%s", strings.Join(lines, "\n"))
// For staticcheck SA0511...
panic("unreachable code")
}

func TestEnsureBufBigEnough(t *testing.T) {
Expand Down

0 comments on commit 66de078

Please sign in to comment.