test: prove unhealthy schema startup boundary

This commit is contained in:
MiMoCode
2026-07-10 18:55:34 +08:00
parent 1b60c8df33
commit 507da4fe96
2 changed files with 183 additions and 1 deletions
+6 -1
View File
@@ -18,6 +18,7 @@ import (
type Pool struct {
dsn string
reconnectInterval time.Duration
open func(*clickhouse.Options) (clickhouse.Conn, error)
mu sync.RWMutex
conn clickhouse.Conn
healthy bool
@@ -40,7 +41,11 @@ func (p *Pool) connect(ctx context.Context) error {
if err != nil {
return err
}
conn, err := clickhouse.Open(opts)
open := p.open
if open == nil {
open = clickhouse.Open
}
conn, err := open(opts)
if err != nil {
return err
}