From cd8508408a01d6fd4a808868ede175cfec235835 Mon Sep 17 00:00:00 2001 From: Erick Erickson Date: Sun, 12 May 2019 10:36:46 -0700 Subject: [PATCH] SOLR-13454: Investigate ReindexCollectionTest failures. moving bandaid calls --- .../solr/cloud/ReindexCollectionTest.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java b/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java index e6dcc352382..9a7ede813b1 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java @@ -138,12 +138,12 @@ public class ReindexCollectionTest extends SolrCloudTestCase { ReindexCollectionCmd.State state = ReindexCollectionCmd.State.get(coll.getStr(ReindexCollectionCmd.REINDEXING_STATE)); return ReindexCollectionCmd.State.FINISHED == state; }); - // verify the target docs exist - QueryResponse queryResponse = solrClient.query(targetCollection, params(CommonParams.Q, "*:*")); SolrTestCaseJ4.Solr11035BandAid(solrClient, targetCollection, "id", NUM_DOCS, "*:*", "ReindexCollectionTest.testBasicReindexing", true); + // verify the target docs exist + QueryResponse queryResponse = solrClient.query(targetCollection, params(CommonParams.Q, "*:*")); assertEquals("copied num docs", NUM_DOCS, queryResponse.getResults().getNumFound()); } @@ -180,10 +180,10 @@ public class ReindexCollectionTest extends SolrCloudTestCase { ReindexCollectionCmd.State state = ReindexCollectionCmd.State.get(coll.getStr(ReindexCollectionCmd.REINDEXING_STATE)); return ReindexCollectionCmd.State.FINISHED == state; }); - // verify the target docs exist - QueryResponse rsp = solrClient.query(targetCollection, params(CommonParams.Q, "*:*")); SolrTestCaseJ4.Solr11035BandAid(solrClient, targetCollection, "id", NUM_DOCS, "*:*", "ReindexCollectionTest.testSameTargetReindex", true); + // verify the target docs exist + QueryResponse rsp = solrClient.query(targetCollection, params(CommonParams.Q, "*:*")); assertEquals("copied num docs", NUM_DOCS, rsp.getResults().getNumFound()); } @@ -210,10 +210,10 @@ public class ReindexCollectionTest extends SolrCloudTestCase { ReindexCollectionCmd.State state = ReindexCollectionCmd.State.get(coll.getStr(ReindexCollectionCmd.REINDEXING_STATE)); return ReindexCollectionCmd.State.FINISHED == state; }); - // verify the target docs exist - QueryResponse rsp = solrClient.query(targetCollection, params(CommonParams.Q, "*:*")); SolrTestCaseJ4.Solr11035BandAid(solrClient, targetCollection, "id", NUM_DOCS, "*:*", "ReindexCollectionTest.testLossyScherma", true); + // verify the target docs exist + QueryResponse rsp = solrClient.query(targetCollection, params(CommonParams.Q, "*:*")); assertEquals("copied num docs", NUM_DOCS, rsp.getResults().getNumFound()); for (SolrDocument doc : rsp.getResults()) { String id = (String)doc.getFieldValue("id"); @@ -247,11 +247,12 @@ public class ReindexCollectionTest extends SolrCloudTestCase { ReindexCollectionCmd.State state = ReindexCollectionCmd.State.get(coll.getStr(ReindexCollectionCmd.REINDEXING_STATE)); return ReindexCollectionCmd.State.FINISHED == state; }); + SolrTestCaseJ4.Solr11035BandAid(solrClient, targetCollection, "id", 11, "*:*", + "ReindexCollectionTest.testReshapeReindexTarget", true); + // verify the target docs exist QueryResponse rsp = solrClient.query(targetCollection, params(CommonParams.Q, "*:*")); - SolrTestCaseJ4.Solr11035BandAid(solrClient, targetCollection, "id", 11, "*:*", - "ReindexCollectionTest.testReshapeReindexTarget", true); // 10 and 100-109 assertEquals("copied num docs", 11, rsp.getResults().getNumFound()); // verify the correct fields exist @@ -383,11 +384,12 @@ public class ReindexCollectionTest extends SolrCloudTestCase { } solrClient.add(collection, docs); solrClient.commit(collection); - // verify the docs exist - QueryResponse rsp = solrClient.query(collection, params(CommonParams.Q, "*:*")); SolrTestCaseJ4.Solr11035BandAid(solrClient, collection, "id", NUM_DOCS, "*:*", "ReindexCollectionTest.indexDocs", true); + // verify the docs exist + QueryResponse rsp = solrClient.query(collection, params(CommonParams.Q, "*:*")); + assertEquals("num docs", NUM_DOCS, rsp.getResults().getNumFound()); }