Apache Lucene open-source search software
SOLR-12028: Remove BadApples for LIRRollingUpdatesTest
Cao Manh Data9fd0754ba1a
diff --git a/solr/core/src/test/org/apache/solr/cloud/LIRRollingUpdatesTest.java b/solr/core/src/test/org/apache/solr/cloud/LIRRollingUpdatesTest.javaindex af7cab58520..713a6ba476a 100644--- a/solr/core/src/test/org/apache/solr/cloud/LIRRollingUpdatesTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/LIRRollingUpdatesTest.java@@ -96,7 +96,6 @@ public class LIRRollingUpdatesTest extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") //2018-03-10public void testNewReplicaOldLeader() throws Exception {String collection = "testNewReplicaOldLeader";@@ -117,6 +116,8 @@ public class LIRRollingUpdatesTest extends SolrCloudTestCase {.setProperties(oldLir).setNode(cluster.getJettySolrRunner(1).getNodeName()).process(cluster.getSolrClient());+ waitForState("Time waiting for 1x2 collection", collection, clusterShape(1, 2));+addDocs(collection, 2, 0);Slice shard1 = getCollectionState(collection).getSlice("shard1");@@ -161,7 +162,6 @@ public class LIRRollingUpdatesTest extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") //2018-03-10public void testNewLeaderOldReplica() throws Exception {// in case of new leader & old replica, new leader can still put old replica into LIR@@ -187,6 +187,7 @@ public class LIRRollingUpdatesTest extends SolrCloudTestCase {.setProperties(oldLir).setNode(cluster.getJettySolrRunner(1).getNodeName()).process(cluster.getSolrClient());+ waitForState("Time waiting for 1x2 collection", collection, clusterShape(1, 2));Slice shard1 = getCollectionState(collection).getSlice("shard1");Replica notLeader = shard1.getReplicas(x -> x != shard1.getLeader()).get(0);@@ -257,6 +258,7 @@ public class LIRRollingUpdatesTest extends SolrCloudTestCase {.addReplicaToShard(collection, "shard1").setNode(cluster.getJettySolrRunner(2).getNodeName()).process(cluster.getSolrClient());+ waitForState("Timeout waiting for shard1 become active", collection, clusterShape(1, 3));Slice shard1 = getCollectionState(collection).getSlice("shard1");Replica replicaInOldMode = shard1.getReplicas(x -> x != shard1.getLeader()).get(0);@@ -286,6 +288,10 @@ public class LIRRollingUpdatesTest extends SolrCloudTestCase {waitForState("Replica " + replicaInOldMode.getName() + " is not put as DOWN", collection,(liveNodes, collectionState) ->collectionState.getSlice("shard1").getReplica(finalReplicaInOldMode.getName()).getState() == Replica.State.DOWN);+ Replica finalReplicaInNewMode = replicaInNewMode;+ waitForState("Replica " + finalReplicaInNewMode.getName() + " is not put as DOWN", collection,+ (liveNodes, collectionState) ->+ collectionState.getSlice("shard1").getReplica(finalReplicaInNewMode.getName()).getState() == Replica.State.DOWN);// wait a little bitThread.sleep(500);@@ -324,13 +330,11 @@ public class LIRRollingUpdatesTest extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") //2018-03-10public void testNewLeaderAndMixedReplicas() throws Exception {testLeaderAndMixedReplicas(false);}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") //2018-03-10public void testOldLeaderAndMixedReplicas() throws Exception {testLeaderAndMixedReplicas(true);}