diff --git a/internal/store/testhelper_test.go b/internal/store/testhelper_test.go index 8e2adf8..dda9cf9 100644 --- a/internal/store/testhelper_test.go +++ b/internal/store/testhelper_test.go @@ -3,11 +3,9 @@ package store import ( "context" "testing" - "time" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/modules/postgres" - "github.com/testcontainers/testcontainers-go/wait" ) // startPostgres spins up an ephemeral PostgreSQL, applies migrations, @@ -15,13 +13,13 @@ import ( func startPostgres(t *testing.T) string { t.Helper() ctx := context.Background() + // BasicWaitStrategies включает ForLog(...)x2 И ForListeningPort — второй + // критичен на macOS/Windows Docker Desktop (иначе flaky first-run). container, err := postgres.Run(ctx, "postgres:16-alpine", postgres.WithDatabase("dns_ar_test"), postgres.WithUsername("test"), postgres.WithPassword("test"), - testcontainers.WithWaitStrategy( - wait.ForLog("database system is ready to accept connections"). - WithOccurrence(2).WithStartupTimeout(60*time.Second)), + postgres.BasicWaitStrategies(), ) if err != nil { t.Fatalf("start postgres: %v", err)