diff --git a/query/common_test.go b/query/common_test.go index ce977ef6d01..dbcffd0eeae 100644 --- a/query/common_test.go +++ b/query/common_test.go @@ -29,11 +29,17 @@ import ( ) func setSchema(schema string) { - err := client.Alter(context.Background(), &api.Operation{ - Schema: schema, - }) - if err != nil { - panic(fmt.Sprintf("Could not alter schema. Got error %v", err.Error())) + for retry := 0; retry < 3; retry++ { + err := client.Alter(context.Background(), &api.Operation{ + Schema: schema, + }) + if err == nil { + return + } + // We'll panic if we are in last iteration. + if retry == 2 { + panic(fmt.Sprintf("Could not alter schema. Got error %v", err.Error())) + } } }