Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25705

Use dynamic host/post binding for dockerized databases in tests

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Testing Infrastructure
    • 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.

      Attachments

        Activity

          People

            zabetak Stamatis Zampetakis
            zabetak Stamatis Zampetakis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: