postgres: test: remove unused code (#81330)

This commit is contained in:
Gábor Farkas 2024-01-26 09:45:17 +01:00 committed by GitHub
parent 722b78f3e0
commit 7230ec88a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,6 @@ package postgres
import (
"context"
"database/sql"
"fmt"
"math/rand"
"os"
@ -1371,17 +1370,6 @@ func TestIntegrationPostgres(t *testing.T) {
})
}
func InitPostgresTestDB(t *testing.T, jsonData sqleng.JsonData) *sql.DB {
connStr := postgresTestDBConnString()
db, err := sql.Open("postgres", connStr)
require.NoError(t, err, "Failed to init postgres DB")
db.SetMaxOpenConns(jsonData.MaxOpenConns)
db.SetMaxIdleConns(jsonData.MaxIdleConns)
db.SetConnMaxLifetime(time.Duration(jsonData.ConnMaxLifetime) * time.Second)
return db
}
func genTimeRangeByInterval(from time.Time, duration time.Duration, interval time.Duration) []time.Time {
durationSec := int64(duration.Seconds())
intervalSec := int64(interval.Seconds())