bharos opened a new issue, #9025:
URL: https://github.com/apache/gravitino/issues/9025

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   PostgreSQL integration tests fail to connect to the container because the 
code uses internal container networking instead of host-mapped ports.
   
   **Issue:**
   - Tests use `getContainerIpAddress():5432` which points to internal Docker 
network (e.g., `172.17.0.2:5432`)
   - This address is not accessible from the host running the tests
   - Docker maps container port 5432 to a random host port, but tests don't use 
the mapped port
   
   **Expected:** Tests should connect using host-accessible endpoints
   **Actual:** Connection failures and test timeouts
   
   ### Error message and/or stacktrace
   
   java.sql.SQLException: Connection to 172.17.0.2:5432 refused. 
   Check that the hostname and port are correct and that the 
   postmaster is accepting TCP/IP connections.
   
   OR
   
   [Test hangs indefinitely due to connection timeout]
   
   Logs show:
   2025-11-05 ERROR PostgreSQLContainer - Command [pg_isready, -h, localhost, 
-U, root] exited with 2
   2025-11-05 ERROR PostgreSQLContainer - stderr: pg_isready: could not connect 
to server: Connection refused
   
   ### How to reproduce
   
   ```
   # What Docker actually does:
   docker run -p 32768:5432 postgres:13
   #               ↑      ↑
   #         host port   container port
   
   # Old code tries: 172.17.0.2:5432 
   # Should use:     localhost:32768 
   ```
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to