From a5a61163f1931c452f952745d494b5a4a81ba99d Mon Sep 17 00:00:00 2001 From: Guanghao Zhang Date: Tue, 8 Jan 2019 16:52:53 +0800 Subject: [PATCH] HBASE-21695 Fix flaky test TestRegionServerAbortTimeout --- .../hbase/regionserver/TestRegionServerAbortTimeout.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbortTimeout.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbortTimeout.java index f134519bef5..7a92664db64 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbortTimeout.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbortTimeout.java @@ -38,6 +38,7 @@ import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.RegionObserver; +import org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RegionServerTests; import org.apache.hadoop.hbase.util.Bytes; @@ -89,6 +90,9 @@ public class TestRegionServerAbortTimeout { @AfterClass public static void tearDown() throws Exception { + // Wait the SCP of abort rs to finish + UTIL.waitFor(30000, () -> UTIL.getMiniHBaseCluster().getMaster().getProcedures().stream() + .filter(p -> p instanceof ServerCrashProcedure && p.isFinished()).count() > 0); UTIL.getAdmin().disableTable(TABLE_NAME); UTIL.getAdmin().deleteTable(TABLE_NAME); UTIL.shutdownMiniCluster();