Fix flaky tests (#6229)

This commit is contained in:
Matt Keeler 2019-07-29 15:07:25 -04:00 committed by Alvin Huang
parent dbae899796
commit a1725e6b52
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,9 @@ func TestStatusLeaderSecondary(t *testing.T) {
require.Len(r, a2.WANMembers(), 2)
})
testrpc.WaitForLeader(t, a1.RPC, "secondary")
testrpc.WaitForLeader(t, a2.RPC, "primary")
req, _ := http.NewRequest("GET", "/v1/status/leader?dc=secondary", nil)
obj, err := a1.srv.StatusLeader(nil, req)
require.NoError(t, err)
@ -101,6 +104,9 @@ func TestStatusPeersSecondary(t *testing.T) {
require.Len(r, a2.WANMembers(), 2)
})
testrpc.WaitForLeader(t, a1.RPC, "secondary")
testrpc.WaitForLeader(t, a2.RPC, "primary")
req, _ := http.NewRequest("GET", "/v1/status/peers?dc=secondary", nil)
obj, err := a1.srv.StatusPeers(nil, req)
require.NoError(t, err)