Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-2026

TestHTTPSource should use any available port rather than a hardcoded port number

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0
    • Component/s: None
    • Labels:
      None
    1. FLUME-2026.patch
      2 kB
      Hari Shreedharan
    2. FLUME-2026-2.patch
      2 kB
      Mike Percy

      Activity

      Hide
      mpercy Mike Percy added a comment -

      On this one, it would be better to use the pattern where you create a new server socket on port 0, query it to find the port assigned by the OS, then close the socket. Use that port in the test. The OS will not assign that port again right away and you are guaranteed to be able to use it.

      See the findFreePort() utility function in the embedded agent test:

      https://github.com/apache/flume/blob/trunk/flume-ng-embedded-agent/src/test/java/org/apache/flume/agent/embedded/TestEmbeddedAgent.java#L180

      Show
      mpercy Mike Percy added a comment - On this one, it would be better to use the pattern where you create a new server socket on port 0, query it to find the port assigned by the OS, then close the socket. Use that port in the test. The OS will not assign that port again right away and you are guaranteed to be able to use it. See the findFreePort() utility function in the embedded agent test: https://github.com/apache/flume/blob/trunk/flume-ng-embedded-agent/src/test/java/org/apache/flume/agent/embedded/TestEmbeddedAgent.java#L180
      Hide
      mpercy Mike Percy added a comment -

      This is causing test failures also such as https://builds.apache.org/job/flume-trunk/447/

      Show
      mpercy Mike Percy added a comment - This is causing test failures also such as https://builds.apache.org/job/flume-trunk/447/
      Hide
      mpercy Mike Percy added a comment -

      Attaching updated patch, I'm going to commit this as part of my 1.4 RM duties.

      Show
      mpercy Mike Percy added a comment - Attaching updated patch, I'm going to commit this as part of my 1.4 RM duties.
      Hide
      mpercy Mike Percy added a comment -

      I just pushed this to trunk and flume-1.4 branches.

      Show
      mpercy Mike Percy added a comment - I just pushed this to trunk and flume-1.4 branches.
      Hide
      hudson Hudson added a comment -

      Integrated in flume-trunk #448 (See https://builds.apache.org/job/flume-trunk/448/)
      FLUME-2026. TestHTTPSource should use any available port rather than a hardcoded port number. (Revision 15f280f75135f69778f04557ed67e230dea7e2bd)

      Result = FAILURE
      mpercy : http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=15f280f75135f69778f04557ed67e230dea7e2bd
      Files :

      • flume-ng-core/src/test/java/org/apache/flume/source/http/TestHTTPSource.java
      Show
      hudson Hudson added a comment - Integrated in flume-trunk #448 (See https://builds.apache.org/job/flume-trunk/448/ ) FLUME-2026 . TestHTTPSource should use any available port rather than a hardcoded port number. (Revision 15f280f75135f69778f04557ed67e230dea7e2bd) Result = FAILURE mpercy : http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=15f280f75135f69778f04557ed67e230dea7e2bd Files : flume-ng-core/src/test/java/org/apache/flume/source/http/TestHTTPSource.java

        People

        • Assignee:
          hshreedharan Hari Shreedharan
          Reporter:
          hshreedharan Hari Shreedharan
        • Votes:
          0 Vote for this issue
          Watchers:
          3 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development