accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject git commit: ACCUMULO-3111 added some retries when checking the number of splits after merging in MetaSplitIT
Date Thu, 11 Sep 2014 23:07:45 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6.1-SNAPSHOT 279614529 -> 0d76cd520


ACCUMULO-3111 added some retries when checking the number of splits after merging in MetaSplitIT


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

Branch: refs/heads/1.6.1-SNAPSHOT
Commit: 0d76cd5205250469d30cb19f3af73090c295fe70
Parents: 2796145
Author: Billie Rinaldi <billie@apache.org>
Authored: Thu Sep 11 16:07:29 2014 -0700
Committer: Billie Rinaldi <billie@apache.org>
Committed: Thu Sep 11 16:07:29 2014 -0700

----------------------------------------------------------------------
 .../org/apache/accumulo/test/MetaSplitIT.java   | 28 +++++++++++++++-----
 1 file changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0d76cd52/test/src/test/java/org/apache/accumulo/test/MetaSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/MetaSplitIT.java b/test/src/test/java/org/apache/accumulo/test/MetaSplitIT.java
index 4ea2663..8a655dd 100644
--- a/test/src/test/java/org/apache/accumulo/test/MetaSplitIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/MetaSplitIT.java
@@ -22,6 +22,8 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 
 import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.admin.TableOperations;
 import org.apache.accumulo.core.metadata.MetadataTable;
 import org.apache.accumulo.core.metadata.RootTable;
@@ -53,24 +55,36 @@ public class MetaSplitIT extends SimpleMacIT {
     opts.addSplits(MetadataTable.NAME, splits);
   }
 
-  @Test(timeout = 60000)
+  @Test(timeout = 180000)
   public void testMetadataTableSplit() throws Exception {
     TableOperations opts = getConnector().tableOperations();
     for (int i = 1; i <= 10; i++) {
       opts.create("" + i);
     }
     opts.merge(MetadataTable.NAME, new Text("01"), new Text("02"));
-    assertEquals(1, opts.listSplits(MetadataTable.NAME).size());
+    checkMetadataSplits(1, opts);
     addSplits(opts, "4 5 6 7 8".split(" "));
-    assertEquals(6, opts.listSplits(MetadataTable.NAME).size());
+    checkMetadataSplits(6, opts);
     opts.merge(MetadataTable.NAME, new Text("6"), new Text("9"));
-    assertEquals(4, opts.listSplits(MetadataTable.NAME).size());
+    checkMetadataSplits(4, opts);
     addSplits(opts, "44 55 66 77 88".split(" "));
-    assertEquals(9, opts.listSplits(MetadataTable.NAME).size());
+    checkMetadataSplits(9, opts);
     opts.merge(MetadataTable.NAME, new Text("5"), new Text("7"));
-    assertEquals(6, opts.listSplits(MetadataTable.NAME).size());
+    checkMetadataSplits(6, opts);
     opts.merge(MetadataTable.NAME, null, null);
-    assertEquals(0, opts.listSplits(MetadataTable.NAME).size());
+    checkMetadataSplits(0, opts);
+  }
+
+  private static void checkMetadataSplits(int numSplits, TableOperations opts)
+      throws AccumuloSecurityException, TableNotFoundException,
+      AccumuloException, InterruptedException {
+    for (int i = 0; i < 10; i++) {
+      if (opts.listSplits(MetadataTable.NAME).size() == numSplits) {
+        break;
+      }
+      Thread.sleep(2000);
+    }
+    assertEquals(numSplits, opts.listSplits(MetadataTable.NAME).size());
   }
 
 }


Mime
View raw message