Flume
  1. Flume
  2. FLUME-2026

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: v1.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
      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
      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
      Mike Percy added a comment -

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

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

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

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

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

      Show
      Mike Percy added a comment - I just pushed this to trunk and flume-1.4 branches.
      Hide
      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 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:
          Hari Shreedharan
          Reporter:
          Hari Shreedharan
        • Votes:
          0 Vote for this issue
          Watchers:
          3 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development