(t testing.TB, conn *pgconn.PgConn)
| 12 | ) |
| 13 | |
| 14 | func closeConn(t testing.TB, conn *pgconn.PgConn) { |
| 15 | ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) |
| 16 | defer cancel() |
| 17 | require.NoError(t, conn.Close(ctx)) |
| 18 | select { |
| 19 | case <-conn.CleanupDone(): |
| 20 | case <-time.After(30 * time.Second): |
| 21 | t.Fatal("Connection cleanup exceeded maximum time") |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | // Do a simple query to ensure the connection is still usable |
| 26 | func ensureConnValid(t *testing.T, pgConn *pgconn.PgConn) { |
no test coverage detected