mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
tests: wait until leadership loop finishes
Reverts d5c7d6e491 .
We actually need to forward the request to ensure that the leader is
properly configured and that establishedLeadership completes.
This commit is contained in:
@@ -83,9 +83,9 @@ type rpcFn func(string, interface{}, interface{}) error
|
||||
|
||||
// WaitForLeader blocks until a leader is elected.
|
||||
func WaitForLeader(t testing.T, rpc rpcFn) {
|
||||
t.Helper()
|
||||
WaitForResult(func() (bool, error) {
|
||||
args := &structs.GenericRequest{}
|
||||
args.AllowStale = true
|
||||
var leader string
|
||||
err := rpc("Status.Leader", args, &leader)
|
||||
return leader != "", err
|
||||
|
||||
Reference in New Issue
Block a user