From 7413258aa61b6c85344f23c69b073da7bacd33cd Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Thu, 17 Sep 2020 07:33:07 -0700 Subject: [PATCH] (release/v20.07) test: retry getting client in TestNodes. (cherry picked from commit 512c69bf7ebd94b3e2a970b520f8794c72afa92a) --- systest/group-delete/group_delete_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/systest/group-delete/group_delete_test.go b/systest/group-delete/group_delete_test.go index 7b7653cf970..de0ce3dc96f 100644 --- a/systest/group-delete/group_delete_test.go +++ b/systest/group-delete/group_delete_test.go @@ -125,7 +125,15 @@ func getError(rc io.ReadCloser) error { } func TestNodes(t *testing.T) { - dg, err := testutil.GetClientToGroup("1") + var dg *dgo.Dgraph + var err error + for i := 0; i < 3; i++ { + dg, err = testutil.GetClientToGroup("1") + if err == nil { + break + } + time.Sleep(5*time.Second) + } require.NoError(t, err, "error while getting connection to group 1") NodesSetup(t, dg)