From b280a41ba661f205eb5de33bb8e03c33e2b005d6 Mon Sep 17 00:00:00 2001 From: chenheng Date: Fri, 27 Nov 2015 11:24:15 +0800 Subject: [PATCH] HBASE-14884 TestSplitTransactionOnCluster.testSSHCleanupDaugtherRegionsOfAbortedSplit is flakey --- .../regionserver/TestSplitTransactionOnCluster.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java index 4b12cffcd25..41fbae640ec 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java @@ -972,20 +972,21 @@ public class TestSplitTransactionOnCluster { List regions = cluster.getRegions(desc.getTableName()); int serverWith = cluster.getServerWith(regions.get(0).getRegionInfo().getRegionName()); HRegionServer regionServer = cluster.getRegionServer(serverWith); - cluster.getServerWith(regions.get(0).getRegionInfo().getRegionName()); SplitTransactionImpl st = new SplitTransactionImpl(regions.get(0), Bytes.toBytes("r3")); st.prepare(); st.stepsBeforePONR(regionServer, regionServer, false); Path tableDir = FSUtils.getTableDir(cluster.getMaster().getMasterFileSystem().getRootDir(), desc.getTableName()); - tableDir.getFileSystem(cluster.getConfiguration()); List regionDirs = FSUtils.getRegionDirs(tableDir.getFileSystem(cluster.getConfiguration()), tableDir); assertEquals(3,regionDirs.size()); - cluster.startRegionServer(); regionServer.kill(); - cluster.getRegionServerThreads().get(serverWith).join(); + // Before we check deadServerInProgress, we should ensure server is dead at master side. + while (!cluster.getMaster().getServerManager(). + getDeadServers().isDeadServer(regionServer.serverName)) { + Thread.sleep(10); + } // Wait until finish processing of shutdown while (cluster.getMaster().getServerManager().areDeadServersInProgress()) { Thread.sleep(10);