From 8ea1719aef7b4d635ae8a5ed8e66e2e23e1a8855 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Mon, 30 Jan 2012 00:41:39 +0000 Subject: [PATCH] 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 --- .../core/src/test/org/apache/solr/cloud/ChaosMonkey.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java index ac6488394e0..34f54679fc9 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java @@ -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 leaders = shardToLeaderJetty.values(); - List leadersList = new ArrayList(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 jetties = shardToJetty.get(slice);