ACCUMULO-2433 Can't reliably assume we won't get stale data with >1 tserver in 
test.

Add some retries to make sure we don't get stale data from ZooCache if we 
happen to talk
to the other MAC tserver.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/729e11ad
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/729e11ad
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/729e11ad

Branch: refs/heads/master
Commit: 729e11adfe862d328d82b1df34fdd18493672c32
Parents: 4a05a17
Author: Josh Elser <els...@apache.org>
Authored: Thu Mar 27 15:35:36 2014 -0700
Committer: Josh Elser <els...@apache.org>
Committed: Thu Mar 27 15:35:36 2014 -0700

----------------------------------------------------------------------
 .../org/apache/accumulo/test/ShellServerTest.java     | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/729e11ad/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java 
b/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java
index 7bda585..624b3c2 100644
--- a/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java
+++ b/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java
@@ -64,6 +64,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.tools.DistCp;
 import org.junit.AfterClass;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
@@ -454,8 +455,17 @@ public class ShellServerTest {
       }
     });
     exec("addauths -s foo,bar", true);
-    exec("getauths", true, "foo", true);
-    exec("getauths", true, "bar", true);
+    boolean passed = false;
+    for (int i = 0; i < 50 && !passed; i++) {
+      try {
+        exec("getauths", true, "foo", true);
+        exec("getauths", true, "bar", true);
+        passed = true;
+      } catch (Exception e) {
+        UtilWaitThread.sleep(300);
+      }
+    }
+    Assert.assertTrue("Could not successfully see updated authoriations", 
passed);
     exec("insert a b c d -l foo");
     exec("scan", true, "[foo]");
     exec("scan -s bar", true, "[foo]", false);

Reply via email to