Revert "Remove `WaitForResult` from two failing tests"

This reverts commit f0842409cd.
pull/173/head
William Tisäter 11 years ago
parent 3f361972ac
commit 4685e1c51f

@ -173,10 +173,11 @@ func TestClient_RPC_TLS(t *testing.T) {
t.Fatalf("bad len")
}
time.Sleep(100 * time.Millisecond)
// RPC should succeed
if err := c1.RPC("Status.Ping", struct{}{}, &out); err != nil {
testutil.WaitForResult(func() (bool, error) {
err := c1.RPC("Status.Ping", struct{}{}, &out)
return err == nil, err
}, func(err error) {
t.Fatalf("err: %v", err)
}
})
}

@ -291,13 +291,16 @@ func TestServer_JoinLAN_TLS(t *testing.T) {
t.Fatalf("bad len")
})
time.Sleep(100 * time.Millisecond)
// Verify Raft has established a peer
if s1.Stats()["raft"]["num_peers"] != "1" {
t.Fatalf("bad: %v", s1.Stats()["raft"])
}
if s2.Stats()["raft"]["num_peers"] != "1" {
t.Fatalf("bad: %v", s2.Stats()["raft"])
}
testutil.WaitForResult(func() (bool, error) {
return s1.Stats()["raft"]["num_peers"] == "1", nil
}, func(err error) {
t.Fatalf("no peer established")
})
testutil.WaitForResult(func() (bool, error) {
return s2.Stats()["raft"]["num_peers"] == "1", nil
}, func(err error) {
t.Fatalf("no peer established")
})
}

Loading…
Cancel
Save