Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B802B200B67 for ; Mon, 1 Aug 2016 23:05:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B6903160A66; Mon, 1 Aug 2016 21:05:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 16119160A6C for ; Mon, 1 Aug 2016 23:05:52 +0200 (CEST) Received: (qmail 50201 invoked by uid 500); 1 Aug 2016 21:05:52 -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 50138 invoked by uid 99); 1 Aug 2016 21:05:52 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2016 21:05:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E4291E0B40; Mon, 1 Aug 2016 21:05:51 +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, 01 Aug 2016 21:05:52 -0000 Message-Id: <9abbd38ca91d4a83a700a733cda794ce@git.apache.org> In-Reply-To: <949b2e5d9f3c414f8e58206813635609@git.apache.org> References: <949b2e5d9f3c414f8e58206813635609@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/10] accumulo git commit: ACCUMULO-4394 Fix up ShellServerIT#addauths archived-at: Mon, 01 Aug 2016 21:05:53 -0000 ACCUMULO-4394 Fix up ShellServerIT#addauths The first loop did not set success=true upon success and would always iterate 9 times. We don't have to limit the number of attempts, instead rely on the junit timeout rule and run for as long as allowed. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d79776d7 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d79776d7 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d79776d7 Branch: refs/heads/1.7 Commit: d79776d78d47570915a6195e1734807160ae566d Parents: dcc5dff Author: Josh Elser Authored: Mon Aug 1 16:20:16 2016 -0400 Committer: Josh Elser Committed: Mon Aug 1 16:20:16 2016 -0400 ---------------------------------------------------------------------- .../org/apache/accumulo/test/ShellServerIT.java | 26 ++++++-------------- 1 file changed, 8 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/d79776d7/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java index 77496ce..95066a5 100644 --- a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java +++ b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java @@ -598,7 +598,8 @@ public class ShellServerIT extends SharedMiniClusterIT { // addauths ts.exec("createtable " + table + " -evc"); boolean success = false; - for (int i = 0; i < 9 && !success; i++) { + // Rely on the timeout rule in AccumuloIT + while (!success) { try { ts.exec("insert a b c d -l foo", false, "does not have authorization", true, new ErrorMessageCallback() { @Override @@ -611,34 +612,23 @@ public class ShellServerIT extends SharedMiniClusterIT { } } }); + success = true; } catch (AssertionError e) { - Thread.sleep(200); + Thread.sleep(500); } } - if (!success) { - ts.exec("insert a b c d -l foo", false, "does not have authorization", true, new ErrorMessageCallback() { - @Override - public String getErrorMessage() { - try { - Connector c = getConnector(); - return "Current auths for root are: " + c.securityOperations().getUserAuthorizations("root").toString(); - } catch (Exception e) { - return "Could not check authorizations"; - } - } - }); - } ts.exec("addauths -s foo,bar", true); boolean passed = false; - for (int i = 0; i < 50 && !passed; i++) { + // Rely on the timeout rule in AccumuloIT + while (!passed) { try { ts.exec("getauths", true, "foo", true); ts.exec("getauths", true, "bar", true); passed = true; } catch (Exception e) { - UtilWaitThread.sleep(300); + UtilWaitThread.sleep(500); } catch (AssertionError e) { - UtilWaitThread.sleep(300); + UtilWaitThread.sleep(500); } } assertTrue("Could not successfully see updated authoriations", passed);