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++; }