Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test for sql wait strategy #214

Closed
wants to merge 10 commits into from
6 changes: 6 additions & 0 deletions wait/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func ForSQL(port nat.Port, driver string, url func(string, nat.Port) string) *wa
Port: port,
URL: url,
Driver: driver,
// Not using the default duration here because it is too low. It will never work
mdelapenya marked this conversation as resolved.
Show resolved Hide resolved
startupTimeout: defaultStartupTimeout(),
mdelapenya marked this conversation as resolved.
Show resolved Hide resolved
PollInterval: defaultPollInterval(),
mdelapenya marked this conversation as resolved.
Show resolved Hide resolved
query: defaultForSqlQuery,
Expand Down Expand Up @@ -88,6 +89,11 @@ func (w *waitForSql) WaitUntilReady(ctx context.Context, target StrategyTarget)
return fmt.Errorf("sql.Open: %v", err)
}
defer db.Close()

db.SetConnMaxLifetime(0)
mdelapenya marked this conversation as resolved.
Show resolved Hide resolved
db.SetMaxIdleConns(3)
db.SetMaxOpenConns(3)

for {
select {
case <-ctx.Done():
Expand Down