From fa7731de6e1a343f079fa81ba7411c14609cb3c9 Mon Sep 17 00:00:00 2001 From: Matteo Bertozzi Date: Fri, 2 Sep 2016 16:49:17 -0700 Subject: [PATCH] HBASE-16552 MiniHBaseCluster#getServerWith() does not ignore stopped RSs --- .../java/org/apache/hadoop/hbase/MiniHBaseCluster.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java index f788bed1d26..706d8e736f7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java @@ -696,10 +696,12 @@ public class MiniHBaseCluster extends HBaseCluster { int count = 0; for (JVMClusterUtil.RegionServerThread rst: getRegionServerThreads()) { HRegionServer hrs = rst.getRegionServer(); - Region region = hrs.getOnlineRegion(regionName); - if (region != null) { - index = count; - break; + if (!hrs.isStopped()) { + Region region = hrs.getOnlineRegion(regionName); + if (region != null) { + index = count; + break; + } } count++; }