Skip to content

Commit 0593018

Browse files
committed
test: wait for queue cluster
We need to wait for a successful role cluster configuration because an instance bootstrap may haven't finished yet. Part of #291
1 parent 38f635b commit 0593018

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

queue/queue_test.go

+15-6
Original file line numberDiff line numberDiff line change
@@ -938,13 +938,22 @@ func runTestMain(m *testing.M) int {
938938

939939
defer test_helpers.StopTarantoolInstances(instances)
940940

941-
roles := []bool{false, true}
942-
connOpts := Opts{
943-
Timeout: 500 * time.Millisecond,
944-
User: "test",
945-
Pass: "test",
941+
for i := 0; i < 10; i++ {
942+
// We need to skip bootstrap errors and to make sure that cluster is
943+
// configured.
944+
roles := []bool{false, true}
945+
connOpts := Opts{
946+
Timeout: 500 * time.Millisecond,
947+
User: "test",
948+
Pass: "test",
949+
}
950+
951+
err = test_helpers.SetClusterRO(serversPool, connOpts, roles)
952+
if err == nil {
953+
break
954+
}
955+
time.Sleep(time.Second)
946956
}
947-
err = test_helpers.SetClusterRO(serversPool, connOpts, roles)
948957

949958
if err != nil {
950959
log.Fatalf("Failed to set roles in tarantool pool: %s", err)

0 commit comments

Comments
 (0)