Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Currently all dockerized databases (subclasses of DatabaseRule, subclasses of 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:
Bind for 0.0.0.0:5432 failed: port is already allocated.
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.