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/01/24 02:36:53 UTC
[2/2] lucene-solr:jira/solr-11702: SOLR-11702: Hardness
ForceLeaderTest
SOLR-11702: Hardness ForceLeaderTest
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/4000cb94
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/4000cb94
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/4000cb94
Branch: refs/heads/jira/solr-11702
Commit: 4000cb94f83bfe6090aa2df0954f5c64e2146a3d
Parents: f718c59
Author: Cao Manh Dat <da...@apache.org>
Authored: Wed Jan 24 09:36:39 2018 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Wed Jan 24 09:36:39 2018 +0700
----------------------------------------------------------------------
solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java | 4 ++++
solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/4000cb94/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java b/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
index 3b40bfb..4540a3f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
@@ -97,6 +97,10 @@ public class ForceLeaderTest extends HttpPartitionTest {
log.info("Before put non leaders into lower term: " + printClusterStateInfo());
putNonLeadersIntoLowerTerm(testCollectionName, SHARD1, zkController, leader, notLeaders);
+ for (Replica replica : notLeaders) {
+ waitForState(testCollectionName, replica.getName(), State.DOWN, 60000);
+ }
+ waitForState(testCollectionName, leader.getName(), State.DOWN, 60000);
cloudClient.getZkStateReader().forceUpdateCollection(testCollectionName);
ClusterState clusterState = cloudClient.getZkStateReader().getClusterState();
int numActiveReplicas = getNumberOfActiveReplicas(clusterState, testCollectionName, SHARD1);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/4000cb94/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
index 52bcc6e..a18aa31 100644
--- a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
@@ -450,7 +450,7 @@ public class HttpPartitionTest extends AbstractFullDistribZkTestBase {
attemptCollectionDelete(cloudClient, testCollectionName);
}
- private void waitForState(String collection, String replicaName, Replica.State state, long ms) throws KeeperException, InterruptedException {
+ protected void waitForState(String collection, String replicaName, Replica.State state, long ms) throws KeeperException, InterruptedException {
TimeOut timeOut = new TimeOut(ms, TimeUnit.MILLISECONDS, TimeSource.CURRENT_TIME);
Replica.State replicaState = Replica.State.ACTIVE;
while (!timeOut.hasTimedOut()) {