You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/08/21 01:31:10 UTC

[43/50] [abbrv] lucene-solr:jira/http2: SOLR-12680: Fix ClassCastException and AIOOBE in TestSolrConfigHandlerConcurrent

SOLR-12680: Fix ClassCastException and AIOOBE in TestSolrConfigHandlerConcurrent


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/20d0f67e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/20d0f67e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/20d0f67e

Branch: refs/heads/jira/http2
Commit: 20d0f67edd15b03a072e745373297c1886d72f24
Parents: ee498f5
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Mon Aug 20 13:25:56 2018 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Mon Aug 20 13:25:56 2018 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  2 ++
 .../TestSolrConfigHandlerConcurrent.java        | 38 ++++++++++----------
 2 files changed, 22 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/20d0f67e/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 8f8ffc4..c80958b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -318,6 +318,8 @@ Other Changes
 
 * SOLR-12014: Cryptic error message when creating a collection with sharding that violates autoscaling policies (noble)
 
+* SOLR-12680: Fix ClassCastException and AIOOBE in TestSolrConfigHandlerConcurrent. (shalin)
+
 ==================  7.4.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/20d0f67e/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java
index bf982ad..8af461b 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java
@@ -65,21 +65,23 @@ public class TestSolrConfigHandlerConcurrent extends AbstractFullDistribZkTestBa
 
     for (Object o : caches.entrySet()) {
       final Map.Entry e = (Map.Entry) o;
-      Thread t = new Thread() {
-        @Override
-        public void run() {
-          try {
-            ArrayList errs = new ArrayList();
-            collectErrors.add(errs);
-            invokeBulkCall((String)e.getKey() , errs, (Map) e.getValue());
-          } catch (Exception e) {
-            e.printStackTrace();
+      if (e.getValue() instanceof Map) {
+        Map value = (Map) e.getValue();
+        Thread t = new Thread() {
+          @Override
+          public void run() {
+            try {
+              List<String> errs = new ArrayList<>();
+              collectErrors.add(errs);
+              invokeBulkCall((String)e.getKey() , errs, value);
+            } catch (Exception e) {
+              e.printStackTrace();
+            }
           }
-
-        }
-      };
-      threads.add(t);
-      t.start();
+        };
+        threads.add(t);
+        t.start();
+      }
     }
 
 
@@ -146,7 +148,7 @@ public class TestSolrConfigHandlerConcurrent extends AbstractFullDistribZkTestBa
 
 
       //get another node
-      String url = urls.get(urls.size());
+      String url = urls.get(urls.size() - 1);
 
       long startTime = System.nanoTime();
       long maxTimeoutSeconds = 20;
@@ -163,13 +165,13 @@ public class TestSolrConfigHandlerConcurrent extends AbstractFullDistribZkTestBa
 
 
         Object o = getObjectByPath(m, true, asList("query", cacheName, "size"));
-        if(!val1.equals(o)) errmessages.add(StrUtils.formatString("'size' property not set, expected = {0}, actual {1}", val1, o));
+        if(!val1.equals(o.toString())) errmessages.add(StrUtils.formatString("'size' property not set, expected = {0}, actual {1}", val1, o));
 
         o = getObjectByPath(m, true, asList("query", cacheName, "initialSize"));
-        if(!val2.equals(o)) errmessages.add(StrUtils.formatString("'initialSize' property not set, expected = {0}, actual {1}", val2, o));
+        if(!val2.equals(o.toString())) errmessages.add(StrUtils.formatString("'initialSize' property not set, expected = {0}, actual {1}", val2, o));
 
         o = getObjectByPath(m, true, asList("query", cacheName, "autowarmCount"));
-        if(!val3.equals(o)) errmessages.add(StrUtils.formatString("'autowarmCount' property not set, expected = {0}, actual {1}", val3, o));
+        if(!val3.equals(o.toString())) errmessages.add(StrUtils.formatString("'autowarmCount' property not set, expected = {0}, actual {1}", val3, o));
         if(errmessages.isEmpty()) break;
       }
       if(!errmessages.isEmpty()) {