mirror of
https://github.com/status-im/consul.git
synced 2025-03-03 06:40:45 +00:00
command: check LastIndex is not zero while waiting for leader
This commit is contained in:
parent
1f3c1b97a2
commit
d97305e376
@ -79,10 +79,7 @@ func waitForLeader(t *testing.T, httpAddr string) {
|
||||
}
|
||||
testutil.WaitForResult(func() (bool, error) {
|
||||
_, qm, err := client.Catalog().Nodes(nil)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return qm.KnownLeader, nil
|
||||
return err == nil && qm.KnownLeader && qm.LastIndex > 0, err
|
||||
}, func(err error) {
|
||||
t.Fatalf("failed to find leader: %v", err)
|
||||
})
|
||||
|
BIN
consul/structs/.structs.go.swp
Normal file
BIN
consul/structs/.structs.go.swp
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user