diff --git a/protocols/sql/container_test.go b/protocols/sql/container_test.go index 3baa379..3f6a56c 100644 --- a/protocols/sql/container_test.go +++ b/protocols/sql/container_test.go @@ -2,11 +2,9 @@ package sql_test import ( "context" - "fmt" "testing" "time" - "github.com/docker/go-connections/nat" "github.com/maxatome/go-testdeep/td" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" @@ -40,9 +38,12 @@ func PreparePostgresContainer(tb testing.TB) (name string, cfg *config.Server) { "POSTGRES_PASSWORD": dbPassword, "POSTGRES_DB": dbName, }, - WaitingFor: wait.ForSQL(postgresPort, "pgx", func(port nat.Port) string { - return fmt.Sprintf("postgres://%s:%s@localhost:%d/%s", dbUser, dbPassword, port.Int(), dbName) - }), + WaitingFor: wait.ForAll( + wait.ForListeningPort(postgresPort), + /*wait.ForSQL(postgresPort, "pgx", func(port nat.Port) string { + return fmt.Sprintf("postgres://%s:%s@localhost:%d/%s", dbUser, dbPassword, port.Int(), dbName) + }),*/ + ), }, Started: true, Logger: testcontainers.TestLogger(tb), @@ -92,9 +93,12 @@ func PrepareMariaDBContainer(tb testing.TB) (name string, cfg *config.Server) { "MARIADB_RANDOM_ROOT_PASSWORD": "1", "MARIADB_DATABASE": dbName, }, - WaitingFor: wait.ForSQL(mysqlPort, "mysql", func(port nat.Port) string { - return fmt.Sprintf("%s:%s@tcp(localhost:%d)/%s", dbUser, dbPassword, port.Int(), dbName) - }), + WaitingFor: wait.ForAll( + wait.ForListeningPort(mysqlPort), + /* wait.ForSQL(mysqlPort, "mysql", func(port nat.Port) string { + return fmt.Sprintf("%s:%s@tcp(localhost:%d)/%s", dbUser, dbPassword, port.Int(), dbName) + }),*/ + ), }, Started: true, Logger: testcontainers.TestLogger(tb),