You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2019/11/12 20:50:35 UTC

[lucene-solr] branch branch_8x updated: SOLR-13864: SolrTestCaseJ4.getNextAvailablePort() has been deprecated

This is an automated email from the ASF dual-hosted git repository.

hossman pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new b872863  SOLR-13864: SolrTestCaseJ4.getNextAvailablePort() has been deprecated
b872863 is described below

commit b872863da9e06a9f21562830cbd26d24d30a8138
Author: Chris Hostetter <ho...@apache.org>
AuthorDate: Tue Nov 12 13:41:46 2019 -0700

    SOLR-13864: SolrTestCaseJ4.getNextAvailablePort() has been deprecated
    
    (cherry picked from commit 603be023feaf3f8e3e739e532b488068710d9097)
---
 solr/CHANGES.txt                                                 | 3 +++
 solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 304c14e..b966ca7 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -95,6 +95,9 @@ Other Changes
 
 * SOLR-13824: Strictly reject anything after JSON in most APIs (Mikhail Khludnev, Munendra S N)
 
+* SOLR-13864: SolrTestCaseJ4.getNextAvailablePort() has been deprecated (and will be removed in 9.0) since
+  it is fundementally flawed.  Users with tests that depend on this method should restructure them. (hossman)
+
 ==================  8.3.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index 958cb6b..b67e336 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -902,7 +902,10 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {
    * Find next available local port.
    * @return available port number or -1 if none could be found
    * @throws Exception on IO errors
+   * @see <a href="https://issues.apache.org/jira/browse/SOLR-13869">SOLR-13869</a>
+   * @deprecated This method is inherently flawed, see SOLR-13869
    */
+  @Deprecated
   protected static int getNextAvailablePort() throws Exception {
     int port = -1;
     try (ServerSocket s = new ServerSocket(0)) {