accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/4] git commit: ACCUMULO-2913 Some stabilization on MultiInstanceReplicationIT
Date Tue, 17 Jun 2014 00:06:45 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master c2a5f839a -> 358c13e66


ACCUMULO-2913 Some stabilization on MultiInstanceReplicationIT

Saw this one fail with no records in the peer, but it looks like we just expected
the records to be there before they actually made it.


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

Branch: refs/heads/master
Commit: 358c13e664e4b7b576ba422f34f909dbb57e97ec
Parents: 51ec0a2
Author: Josh Elser <elserj@apache.org>
Authored: Mon Jun 16 15:22:33 2014 -0700
Committer: Josh Elser <elserj@apache.org>
Committed: Mon Jun 16 16:24:26 2014 -0700

----------------------------------------------------------------------
 .../replication/MultiInstanceReplicationIT.java | 29 ++++++++++++++------
 1 file changed, 20 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/358c13e6/test/src/test/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
b/test/src/test/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
index fc081b4..29e125c 100644
--- a/test/src/test/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
@@ -608,8 +608,6 @@ public class MultiInstanceReplicationIT extends ConfigurableMacIT {
       }
 
       cluster.exec(TabletServer.class);
-      // connMaster.tableOperations().compact(masterTable1, null, null, true, false);
-      // connMaster.tableOperations().compact(masterTable2, null, null, true, false);
 
       // Wait until we fully replicated something
       boolean fullyReplicated = false;
@@ -628,6 +626,8 @@ public class MultiInstanceReplicationIT extends ConfigurableMacIT {
 
       Assert.assertNotEquals(0, fullyReplicated);
 
+      // We have to wait for the master to assign the replication work, a local tserver to
process it, and then the remote tserver to replay it
+      // Be cautious in how quickly we assert that the data is present on the peer
       long countTable = 0l;
       for (int i = 0; i < 10; i++) {
         for (Entry<Key,Value> entry : connPeer.createScanner(peerTable1, Authorizations.EMPTY))
{
@@ -647,15 +647,26 @@ public class MultiInstanceReplicationIT extends ConfigurableMacIT {
 
       Assert.assertTrue("Found no records in " + peerTable1 + " in the peer cluster", countTable
> 0);
 
-      countTable = 0l;
-      for (Entry<Key,Value> entry : connPeer.createScanner(peerTable2, Authorizations.EMPTY))
{
-        countTable++;
-        Assert.assertTrue("Found unexpected key-value" + entry.getKey().toStringNoTruncate()
+ " " + entry.getValue(), entry.getKey().getRow().toString()
-            .startsWith(masterTable2));
+      // We have to wait for the master to assign the replication work, a local tserver to
process it, and then the remote tserver to replay it
+      // Be cautious in how quickly we assert that the data is present on the peer
+      for (int i = 0; i < 10; i++) {
+        countTable = 0l;
+        for (Entry<Key,Value> entry : connPeer.createScanner(peerTable2, Authorizations.EMPTY))
{
+          countTable++;
+          Assert.assertTrue("Found unexpected key-value" + entry.getKey().toStringNoTruncate()
+ " " + entry.getValue(), entry.getKey().getRow().toString()
+              .startsWith(masterTable2));
+        }
+  
+        log.info("Found {} records in {}", countTable, peerTable2);
+
+        if (0l == countTable) {
+          Thread.sleep(5000);
+        } else {
+          break;
+        }
       }
 
-      log.info("Found {} records in {}", countTable, peerTable2);
-      Assert.assertTrue(countTable > 0);
+      Assert.assertTrue("Found no records in " + peerTable2 + " in the peer cluster", countTable
> 0);
 
     } finally {
       peer1Cluster.stop();


Mime
View raw message