Commit 2b1b6af5 authored by George Papathanail's avatar George Papathanail
Browse files

fix(test): wait for Postgress TCP listener in integration fixture

parent 57a821e9
Loading
Loading
Loading
Loading
Loading
+3 −1
Changes for tests/integration/conftest.py: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -73,7 +73,9 @@ def postgres_url() -> Generator[str, None, None]:
        .with_env("POSTGRES_PASSWORD", "postgres")
        .with_env("POSTGRES_DB", "oeg_test")
        .with_exposed_ports(5432)
        .waiting_for(ExecWaitStrategy(["pg_isready", "-U", "postgres"]))
        # -h forces TCP: the image's init phase runs a socket-only temp server
        # that would satisfy a plain pg_isready before the real one listens.
        .waiting_for(ExecWaitStrategy(["pg_isready", "-h", "127.0.0.1", "-U", "postgres"]))
    )
    with container:
        host = container.get_container_host_ip()