From f363062641c385db4da05088f43836f13dee5b3a Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Mon, 4 Oct 2010 23:01:16 +0000 Subject: [PATCH] Add wait on disable to complete to TestHFileOutputFormat by watching regions in transition...; seems to fix unit test git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1004474 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop/hbase/mapreduce/TestHFileOutputFormat.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java b/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java index 386eb7b5e30..c5d56cc4e25 100644 --- a/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java +++ b/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java @@ -43,6 +43,7 @@ import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.Threads; import org.apache.hadoop.io.NullWritable; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Mapper; @@ -286,6 +287,11 @@ public class TestHFileOutputFormat { if (shouldChangeRegions) { LOG.info("Changing regions in table"); admin.disableTable(table.getTableName()); + while(util.getMiniHBaseCluster().getMaster().getAssignmentManager(). + isRegionsInTransition()) { + Threads.sleep(1000); + LOG.info("Waiting on table to finish disabling"); + } byte[][] newStartKeys = generateRandomStartKeys(15); util.createMultiRegions(util.getConfiguration(), table, FAMILY_NAME, newStartKeys);