mirror of https://github.com/status-im/consul.git
Add wait logic to TestClient_RPC_Pool
This commit is contained in:
parent
e2d9114b34
commit
e1d850c081
|
@ -211,9 +211,14 @@ func TestClient_RPC_Pool(t *testing.T) {
|
||||||
if _, err := c1.JoinLAN([]string{addr}); err != nil {
|
if _, err := c1.JoinLAN([]string{addr}); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
if len(s1.LANMembers()) != 2 || len(c1.LANMembers()) != 2 {
|
|
||||||
t.Fatalf("Server has %v of %v expected members; Client has %v of %v expected members.", len(s1.LANMembers()), 2, len(c1.LANMembers()), 2)
|
// Wait for both agents to finish joining
|
||||||
}
|
testutil.WaitForResult(func() (bool, error) {
|
||||||
|
return len(s1.LANMembers()) == 2 && len(c1.LANMembers()) == 2, nil
|
||||||
|
}, func(err error) {
|
||||||
|
t.Fatalf("Server has %v of %v expected members; Client has %v of %v expected members.",
|
||||||
|
len(s1.LANMembers()), 2, len(c1.LANMembers()), 2)
|
||||||
|
})
|
||||||
|
|
||||||
// Blast out a bunch of RPC requests at the same time to try to get
|
// Blast out a bunch of RPC requests at the same time to try to get
|
||||||
// contention opening new connections.
|
// contention opening new connections.
|
||||||
|
|
Loading…
Reference in New Issue