SOLR-8249: Address OverseerTest.testOverseerStatsReset() failures by switching back from testing for stats on the LEADER operation to testing STATE message stats

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1713669 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2015-11-10 15:28:30 +00:00
parent 84ede2378c
commit 50c89d58e6
1 changed files with 2 additions and 11 deletions

View File

@ -716,18 +716,9 @@ public class OverseerTest extends SolrTestCaseJ4 {
overseerElector.setup(ec);
overseerElector.joinElection(ec, false);
mockController.publishState(collection, "core1", "core_node1", Replica.State.RECOVERING, 1);
mockController.publishState(collection, "core1", "core_node1", Replica.State.ACTIVE, 1);
// Wait till the leader election has finished
long maxWaitTimeForLeaderElection = 5000;
for (int i = 0; i < maxWaitTimeForLeaderElection / 200; i++) {
if (overseer.getStats().getSuccessCount(OverseerAction.LEADER.toLower()) > 0) {
break;
}
Thread.sleep(200);
}
assertNotNull(overseer.getStats());
assertEquals(1, (overseer.getStats().getSuccessCount(OverseerAction.LEADER.toLower())));
assertTrue((overseer.getStats().getSuccessCount(OverseerAction.STATE.toLower())) > 0);
// shut it down
@ -738,7 +729,7 @@ public class OverseerTest extends SolrTestCaseJ4 {
overseerElector.setup(ec);
overseerElector.joinElection(ec, false);
assertNotNull(overseer.getStats());
assertEquals(0, (overseer.getStats().getSuccessCount(OverseerAction.LEADER.toLower())));
assertEquals(0, (overseer.getStats().getSuccessCount(OverseerAction.STATE.toLower())));
} finally {
close(mockController);