api/watch: try to avoid more flakes in this package (#6538)

This commit is contained in:
R.B. Boyer 2019-09-24 11:24:48 -05:00 committed by GitHub
parent 1f99598d18
commit f1b9476cd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,8 @@ func makeClient(t *testing.T) (*api.Client, *testutil.TestServer) {
require.NoError(t, err)
conf.Address = server.HTTPAddr
server.WaitForLeader(t)
// Create client
client, err := api.NewClient(conf)
if err != nil {
@ -370,6 +372,8 @@ func TestNodesWatch(t *testing.T) {
c, s := makeClient(t)
defer s.Stop()
s.WaitForSerfCheck(t) // wait for AE to sync
var (
wakeups [][]*api.Node
notifyCh = make(chan struct{})