Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-959

Remove hardcoded port numbers from TestReplicationHandler

    Details

    • Type: Test
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: replication (java)
    • Labels:
      None

      Description

      TestReplicationHandler has a hardcoded port of 9999 in it for the "master". hardcoding port numbers in unit tests is very brittle and error prone and can cause problems. Ideally tests that aren't explicitly testing network related functionality should avoid dealing with the network at all, but when neccessary it's much better to let the OS pick any available port (as most other solr tests do) then to hardcoded it.

      in TestReplicationHandler things are a little more complicated because the master port number needs to be refered to in the slave config files.

        Attachments

        1. replicationtest-port-refactor.patch
          6 kB
          Hoss Man
        2. SOLR-959.patch
          12 kB
          Akshay K. Ukey

          Activity

            People

            • Assignee:
              shalinmangar Shalin Shekhar Mangar
              Reporter:
              hossman Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: