Stamatis Zampetakis created HIVE-25705: ------------------------------------------
Summary: Use dynamic host/post binding for dockerized databases in tests Key: HIVE-25705 URL: https://issues.apache.org/jira/browse/HIVE-25705 Project: Hive Issue Type: Improvement Components: Testing Infrastructure Reporter: Stamatis Zampetakis Assignee: Stamatis Zampetakis Currently all dockerized databases (subclasses of [DatabaseRule|https://github.com/apache/hive/blob/6e02f6164385a370ee8014c795bee1fa423d7937/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/DatabaseRule.java], subclasses of [AbstractExternalDB.java|https://github.com/apache/hive/blob/6e02f6164385a370ee8014c795bee1fa423d7937/itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/AbstractExternalDB.java]) are mapped statically to a specific hostname (usually localhost) and port when the container is launched; the host/port values are hardcoded in the code. This may create problems when a certain port is already taken by another process leading to errors like the one below: {noformat} Bind for 0.0.0.0:5432 failed: port is already allocated. {noformat} Similar problems can occur by assuming that every database will be accessible on localhost. This can lead to flakiness in CI and/or poor developer experience when running tests backed by Docker. The goal of this case is to allow the containers/databases bind dynamically to a random port at startup and expose the appropriate IP address & port to the tests relying on these databases. -- This message was sent by Atlassian Jira (v8.20.1#820001)