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 415DE1137E for ; Mon, 4 Aug 2014 15:50:59 +0000 (UTC) Received: (qmail 19073 invoked by uid 500); 4 Aug 2014 15:50:59 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 18974 invoked by uid 500); 4 Aug 2014 15:50:59 -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 18896 invoked by uid 99); 4 Aug 2014 15:50:59 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2014 15:50:59 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C2FBF889C86; Mon, 4 Aug 2014 15:50:58 +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: Mon, 04 Aug 2014 15:50:58 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] git commit: ACCUMULO-2694 Ensure that the newly created table is assigned before continuing. Repository: accumulo Updated Branches: refs/heads/1.6.1-SNAPSHOT 533983f10 -> e2dc55027 refs/heads/master f34f1d892 -> 118184bc3 ACCUMULO-2694 Ensure that the newly created table is assigned before continuing. A table can be successfully created, but its tablets not yet assigned. There was a race condition in the test where getMasterMonitorInfo was called before the tablets for the TEST_TABLE were created. This made it appear that the table did not exist. We can mitigate the race condition by trying to read from our TEST_TABLE before returning from the setup method. This ensures that the tablet for our table is online and we should get the expected state from the test. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/e2dc5502 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/e2dc5502 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/e2dc5502 Branch: refs/heads/1.6.1-SNAPSHOT Commit: e2dc5502712f9b2bbb8c3dd1090810d40385d131 Parents: 533983f Author: Josh Elser Authored: Mon Aug 4 11:48:23 2014 -0400 Committer: Josh Elser Committed: Mon Aug 4 11:48:23 2014 -0400 ---------------------------------------------------------------------- .../minicluster/impl/MiniAccumuloClusterImplTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/e2dc5502/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java ---------------------------------------------------------------------- diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java index 32b20b0..2bab291 100644 --- a/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java +++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java @@ -21,13 +21,18 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.Map.Entry; +import org.apache.accumulo.core.client.Scanner; import org.apache.accumulo.core.client.admin.TableOperations; -import org.apache.accumulo.core.master.thrift.MasterMonitorInfo; +import org.apache.accumulo.core.data.Key; +import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.master.thrift.MasterGoalState; +import org.apache.accumulo.core.master.thrift.MasterMonitorInfo; import org.apache.accumulo.core.master.thrift.MasterState; import org.apache.accumulo.core.metadata.MetadataTable; import org.apache.accumulo.core.metadata.RootTable; +import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.minicluster.ServerType; import org.apache.commons.io.FileUtils; import org.apache.log4j.Level; @@ -69,6 +74,9 @@ public class MiniAccumuloClusterImplTest { TableOperations tableops = accumulo.getConnector("root","superSecret").tableOperations(); tableops.create(TEST_TABLE); testTableID = tableops.tableIdMap().get(TEST_TABLE); + + Scanner s = accumulo.getConnector("root", "superSecret").createScanner(TEST_TABLE, Authorizations.EMPTY); + for (@SuppressWarnings("unused") Entry e : s) {} } @Test(timeout = 10000)