diff --git a/dbxtest/dbxtest.go b/dbxtest/dbxtest.go index 1ffcc96..cc95609 100644 --- a/dbxtest/dbxtest.go +++ b/dbxtest/dbxtest.go @@ -46,6 +46,11 @@ func NewTestCluster(t testing.TB, opts ...dbx.Option) *dbx.Cluster { t.Skipf("dbxtest: cannot connect to test database: %v", err) } + if err := cluster.Ping(ctx); err != nil { + cluster.Close() + t.Skipf("dbxtest: cannot reach test database: %v", err) + } + t.Cleanup(func() { cluster.Close() })