mirror of https://github.com/status-im/consul.git
api/watch: try to avoid more flakes in this package (#6538)
This commit is contained in:
parent
4f35b092ce
commit
92fd596d32
|
@ -32,6 +32,8 @@ func makeClient(t *testing.T) (*api.Client, *testutil.TestServer) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
conf.Address = server.HTTPAddr
|
conf.Address = server.HTTPAddr
|
||||||
|
|
||||||
|
server.WaitForLeader(t)
|
||||||
|
|
||||||
// Create client
|
// Create client
|
||||||
client, err := api.NewClient(conf)
|
client, err := api.NewClient(conf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -370,6 +372,8 @@ func TestNodesWatch(t *testing.T) {
|
||||||
c, s := makeClient(t)
|
c, s := makeClient(t)
|
||||||
defer s.Stop()
|
defer s.Stop()
|
||||||
|
|
||||||
|
s.WaitForSerfCheck(t) // wait for AE to sync
|
||||||
|
|
||||||
var (
|
var (
|
||||||
wakeups [][]*api.Node
|
wakeups [][]*api.Node
|
||||||
notifyCh = make(chan struct{})
|
notifyCh = make(chan struct{})
|
||||||
|
|
Loading…
Reference in New Issue