Skip to content

Commit 0e15ab9

Browse files
committed
Increase MaxWait to aid dockertest dockerd access
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent c6a6f1f commit 0e15ab9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/shared/services/pgtest/pgtest.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package pgtest
2020

2121
import (
2222
"fmt"
23+
"time"
2324

2425
"github.com/golang-migrate/migrate"
2526
"github.com/golang-migrate/migrate/database/postgres"
@@ -69,8 +70,8 @@ func SetupTestDB(schemaSource *bindata.AssetSource) (*sqlx.DB, func(), error) {
6970
if err != nil {
7071
return nil, nil, fmt.Errorf("Failed to run docker pool: %w", err)
7172
}
72-
// Set a 5 minute expiration on resources.
73-
err = resource.Expire(300)
73+
// Set a 15 minute expiration on resources (extended for debugging).
74+
err = resource.Expire(900)
7475
if err != nil {
7576
return nil, nil, err
7677
}
@@ -85,6 +86,7 @@ func SetupTestDB(schemaSource *bindata.AssetSource) (*sqlx.DB, func(), error) {
8586
viper.Set("postgres_username", "postgres")
8687
viper.Set("postgres_password", "secret")
8788

89+
pool.MaxWait = 10 * time.Minute
8890
if err = pool.Retry(func() error {
8991
log.Info("trying to connect")
9092
db = pg.MustCreateDefaultPostgresDB()

0 commit comments

Comments
 (0)