Skip to content

Commit 9db993e

Browse files
committed
fixed cleanup for database/sql driver
1 parent 887888a commit 9db993e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/integration/helpers_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,11 @@ func (scope *scopeT) SQLDriver(opts ...ydb.ConnectorOption) *sql.DB {
153153

154154
db := sql.OpenDB(connector)
155155

156-
scope.Logf("Ping db")
157-
err = db.PingContext(scope.Ctx)
158-
if err != nil {
159-
return nil, err
156+
clean := func() {
157+
scope.Require.NoError(db.Close())
160158
}
161159

162-
return fixenv.NewGenericResult(db), nil
160+
return fixenv.NewGenericResultWithCleanup(db, clean), nil
163161
}
164162
return fixenv.CacheResult(scope.Env, f)
165163
}

0 commit comments

Comments
 (0)