package archive import ( "context" "time" "github.com/jackc/pgx/v5" ) // SetRetryPause sets the pause before DropUnused tries its lock on // records again, for a test that waits through a retry. func SetRetryPause(d time.Duration) { retryPause = d } // Connection is a connection of the archive's pool, taken out of the // pool, for a test to read its socket. func (a *Archive) Connection(ctx context.Context) (*pgx.Conn, error) { c, err := a.pool.Acquire(ctx) if err != nil { return nil, err } return c.Hijack(), nil }