Merged in bugfix/fixe2etests (pull request #64)

Fix e2e test

* fix
This commit is contained in:
Michael McGuinness
2025-02-13 00:23:13 +00:00
parent c1e9d93037
commit f5bd522faf
12 changed files with 82 additions and 84 deletions
+7
View File
@@ -7,6 +7,7 @@ import (
"queryorchestration/internal/serviceconfig"
"queryorchestration/internal/serviceconfig/database"
"testing"
"time"
"github.com/docker/go-connections/nat"
"github.com/testcontainers/testcontainers-go"
@@ -43,6 +44,12 @@ func CreateDB(t *testing.T, ctx context.Context, cfg *CreateDatabaseConfig) (tes
wait.ForExposedPort(),
wait.ForListeningPort(port),
wait.ForLog("database system is ready to accept connections"),
wait.ForSQL(port, "postgres", func(host string, port nat.Port) string {
return fmt.Sprintf("postgres://%s:%s@localhost:%s/%s?sslmode=disable",
user, pass, port.Port(), name)
}).
WithStartupTimeout(25*time.Second).
WithPollInterval(10*time.Second),
),
}