mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 14:24:39 +00:00
Wait for agent joins to finish in TestClient_RPC
This commit is contained in:
parent
f6c971f46c
commit
ae99f76763
@ -343,17 +343,16 @@ func TestClient_RPC_TLS(t *testing.T) {
|
|||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the members
|
// Wait for joins to finish/RPC to succeed
|
||||||
if len(s1.LANMembers()) != 2 {
|
|
||||||
t.Fatalf("bad len")
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(c1.LANMembers()) != 2 {
|
|
||||||
t.Fatalf("bad len")
|
|
||||||
}
|
|
||||||
|
|
||||||
// RPC should succeed
|
|
||||||
testutil.WaitForResult(func() (bool, error) {
|
testutil.WaitForResult(func() (bool, error) {
|
||||||
|
if len(s1.LANMembers()) != 2 {
|
||||||
|
return false, fmt.Errorf("bad len: %v", len(s1.LANMembers()))
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(c1.LANMembers()) != 2 {
|
||||||
|
return false, fmt.Errorf("bad len: %v", len(c1.LANMembers()))
|
||||||
|
}
|
||||||
|
|
||||||
err := c1.RPC("Status.Ping", struct{}{}, &out)
|
err := c1.RPC("Status.Ping", struct{}{}, &out)
|
||||||
return err == nil, err
|
return err == nil, err
|
||||||
}, func(err error) {
|
}, func(err error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user