when aggressively killing leaders in tests, don't go after any leader, go after the leader for the given slice

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1237513 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-01-30 00:41:39 +00:00
parent 124b5e3477
commit 8ea1719aef
1 changed files with 1 additions and 8 deletions

View File

@ -19,7 +19,6 @@ package org.apache.solr.cloud;
import java.net.BindException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Random;
@ -297,13 +296,7 @@ public class ChaosMonkey {
JettySolrRunner jetty;
if (chance <= 5 && aggressivelyKillLeaders) {
// if killLeader, really aggressively go after leaders
Collection<CloudJettyRunner> leaders = shardToLeaderJetty.values();
List<CloudJettyRunner> leadersList = new ArrayList<CloudJettyRunner>(leaders.size());
leadersList.addAll(leaders);
int index = random.nextInt(leadersList.size());
jetty = leadersList.get(index).jetty;
jetty = shardToLeaderJetty.get(slice).jetty;
} else {
// get random shard
List<CloudJettyRunner> jetties = shardToJetty.get(slice);