Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13868 Eliminate 'Port Roulette' in Solr Testing
  3. SOLR-13869

deprecated and remove SolrTestCaseJ4.getNextAvailablePort

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: master (9.0), 8.4
    • Component/s: None
    • Labels:
      None

      Description

      SolrTestCaseJ4.getNextAvailablePort() is a problematic method in that the entire premise assumes that since the OS allowed us to bind to a port once, it will allow us to re-bind to that port again at some future point in the text execution – but that is not garunteed, as soon as getNextAvailablePort() releases the port assigned to new ServerSocket(0) the OS may allocate that port to some other process.

      We should deprecate & remove this method getNextAvailablePort() to prevent tests from adopting this bad pattern.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hossman Chris M. Hostetter
                Reporter:
                hossman Chris M. Hostetter
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: