From 792f69e3f3d5e10f0d2cab81d0af44183c19f3bf Mon Sep 17 00:00:00 2001 From: zhangduo Date: Thu, 25 Apr 2019 22:56:47 +0800 Subject: [PATCH] HBASE-22297 Addendum make TestSplitTransactionOnCluster more stable --- .../regionserver/TestSplitTransactionOnCluster.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 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 21d8297e7a25..d7b2f9eeb580 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 @@ -31,6 +31,7 @@ import java.util.Map; import java.util.Optional; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.hadoop.conf.Configuration; @@ -511,17 +512,13 @@ public void testSplitShouldNotThrowNPEEvenARegionHasEmptySplitFiles() throws Exc } /** - * Verifies HBASE-5806. Here the case is that splitting is completed but before the - * CJ could remove the parent region the master is killed and restarted. - * @throws IOException - * @throws InterruptedException - * @throws NodeExistsException - * @throws KeeperException + * Verifies HBASE-5806. Here the case is that splitting is completed but before the CJ could + * remove the parent region the master is killed and restarted. */ @Test public void testMasterRestartAtRegionSplitPendingCatalogJanitor() throws IOException, InterruptedException, NodeExistsException, - KeeperException, ServiceException { + KeeperException, ServiceException, ExecutionException { final TableName tableName = TableName.valueOf(name.getMethodName()); // Create table then get the single region for our new table. @@ -542,7 +539,7 @@ public void testMasterRestartAtRegionSplitPendingCatalogJanitor() HRegionServer server = cluster.getRegionServer(tableRegionIndex); printOutRegions(server, "Initial regions: "); // Call split. - this.admin.splitRegionAsync(hri.getRegionName()); + this.admin.splitRegionAsync(hri.getRegionName()).get(); List daughters = checkAndGetDaughters(tableName); // Before cleanup, get a new master.