Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A6EC11C88 for ; Wed, 17 Sep 2014 21:23:35 +0000 (UTC) Received: (qmail 38576 invoked by uid 500); 17 Sep 2014 21:23:34 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 38532 invoked by uid 500); 17 Sep 2014 21:23:34 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 38482 invoked by uid 99); 17 Sep 2014 21:23:34 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2014 21:23:34 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 48596A198A4; Wed, 17 Sep 2014 21:23:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Wed, 17 Sep 2014 21:23:34 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] git commit: ACCUMULO-3139 Some extra test stabilizations for BalanceAfterCommsFailureIT Repository: accumulo Updated Branches: refs/heads/1.6.1-SNAPSHOT 4cf467b92 -> d0f95f85a refs/heads/master f90da7c7b -> 59875c298 ACCUMULO-3139 Some extra test stabilizations for BalanceAfterCommsFailureIT Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d0f95f85 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d0f95f85 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d0f95f85 Branch: refs/heads/1.6.1-SNAPSHOT Commit: d0f95f85a484e190ddaeb753ab141ce7c3d84ff1 Parents: 4cf467b Author: Josh Elser Authored: Wed Sep 17 17:07:30 2014 -0400 Committer: Josh Elser Committed: Wed Sep 17 17:07:30 2014 -0400 ---------------------------------------------------------------------- .../test/functional/BalanceAfterCommsFailureIT.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/d0f95f85/test/src/test/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java index f062c8f..39e7e70 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java @@ -35,6 +35,7 @@ import org.apache.accumulo.core.master.thrift.MasterClientService; import org.apache.accumulo.core.master.thrift.MasterMonitorInfo; import org.apache.accumulo.core.master.thrift.TableInfo; import org.apache.accumulo.core.master.thrift.TabletServerStatus; +import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.security.Credentials; import org.apache.accumulo.fate.util.UtilWaitThread; import org.apache.accumulo.minicluster.ServerType; @@ -45,6 +46,8 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.Text; import org.junit.Test; +import com.google.common.collect.Iterables; + public class BalanceAfterCommsFailureIT extends ConfigurableMacIT { @Override @@ -87,6 +90,8 @@ public class BalanceAfterCommsFailureIT extends ConfigurableMacIT { splits.add(new Text(split)); } c.tableOperations().addSplits("test", splits); + // Ensure all of the tablets are actually assigned + assertEquals(0, Iterables.size(c.createScanner("test", Authorizations.EMPTY))); UtilWaitThread.sleep(10 * 1000); checkBalance(c); } @@ -111,8 +116,10 @@ public class BalanceAfterCommsFailureIT extends ConfigurableMacIT { } counts.add(count); } - assertTrue(counts.size() > 1); - for (int i = 1; i < counts.size(); i++) - assertTrue(Math.abs(counts.get(0) - counts.get(i)) <= counts.size()); + assertTrue("Expected to have at least two TabletServers", counts.size() > 1); + for (int i = 1; i < counts.size(); i++) { + int diff = Math.abs(counts.get(0) - counts.get(i)); + assertTrue("Expected difference in tablets to be less than or equal to " + counts.size() + " but was " + diff, diff <= counts.size()); + } } }