From 34c9a6b93dab45088ad9c6858125774116919771 Mon Sep 17 00:00:00 2001 From: Kirill Gavrilov Date: Fri, 25 Aug 2023 14:22:40 +0300 Subject: [PATCH] fix waiting coordinator nil --- test/feature/spqr_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/feature/spqr_test.go b/test/feature/spqr_test.go index 781973580..506d27343 100644 --- a/test/feature/spqr_test.go +++ b/test/feature/spqr_test.go @@ -253,6 +253,7 @@ func (tctx *testContext) establishCoordinatorConnection() error { return nil } } + delete(tctx.dbs, "coordinator") if !ok || err != nil { // check coordinator @@ -270,12 +271,14 @@ func (tctx *testContext) establishCoordinatorConnection() error { } tctx.dbs["coordinator"] = db - return nil } } } - return fmt.Errorf("failed to connect to coordinator") + if _, ok := tctx.dbs["coordinator"]; !ok { + return fmt.Errorf("failed to connect to coordinator") + } + return nil } func (tctx *testContext) getPostgresqlConnection(host string) (*sqlx.DB, error) {