From 88bad1c5ea18a8e948172c5398e59e4c343f43eb Mon Sep 17 00:00:00 2001 From: chenheng Date: Thu, 7 Jul 2016 11:40:45 +0800 Subject: [PATCH] HBASE-16190 IntegrationTestDDLMasterFailover failed with IllegalArgumentException: n must be positive --- .../org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java index 4b75ce2..dbe6a1f 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java @@ -252,6 +252,9 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } // synchronization to prevent removal from multiple threads synchronized (namespaceMap) { + if (namespaceMap.isEmpty()) { + return null; + } ArrayList namespaceList = new ArrayList(namespaceMap.keySet()); String randomKey = namespaceList.get(RandomUtils.nextInt(namespaceList.size())); NamespaceDescriptor randomNsd = namespaceMap.get(randomKey); @@ -392,6 +395,9 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } // synchronization to prevent removal from multiple threads synchronized (tableMap){ + if (tableMap.isEmpty()) { + return null; + } ArrayList tableList = new ArrayList(tableMap.keySet()); TableName randomKey = tableList.get(RandomUtils.nextInt(tableList.size())); HTableDescriptor randomHtd = tableMap.get(randomKey); -- 1.9.3 (Apple Git-50)