accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [35/35] git commit: ACCUMULO-378 More test stabilization
Date Thu, 05 Jun 2014 04:43:17 GMT
ACCUMULO-378 More test stabilization


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

Branch: refs/heads/ACCUMULO-378
Commit: 856f2359004f3b4ff209fc6ff61db76d4ab4c192
Parents: ada6ce4
Author: Josh Elser <elserj@apache.org>
Authored: Thu Jun 5 00:35:19 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Jun 5 00:35:19 2014 -0400

----------------------------------------------------------------------
 .../test/replication/ReplicationTest.java         | 18 +++++++++++++++++-
 .../UnorderedWorkAssignerReplicationIT.java       |  2 +-
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/856f2359/test/src/test/java/org/apache/accumulo/test/replication/ReplicationTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/replication/ReplicationTest.java
b/test/src/test/java/org/apache/accumulo/test/replication/ReplicationTest.java
index 04d1d6e..8554950 100644
--- a/test/src/test/java/org/apache/accumulo/test/replication/ReplicationTest.java
+++ b/test/src/test/java/org/apache/accumulo/test/replication/ReplicationTest.java
@@ -344,6 +344,22 @@ public class ReplicationTest extends ConfigurableMacIT {
     conn.securityOperations().grantTablePermission("root", ReplicationTable.NAME, TablePermission.READ);
 
     Set<String> tableIds = Sets.newHashSet(conn.tableOperations().tableIdMap().get(table1),
conn.tableOperations().tableIdMap().get(table2));
+    Set<String> tableIdsForMetadata = Sets.newHashSet(tableIds);
+
+    s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
+    s.setRange(MetadataSchema.ReplicationSection.getRange());
+    iter = s.iterator();
+
+    Assert.assertTrue("Found no records in metadata table", iter.hasNext());
+    entry = iter.next();
+    Assert.assertTrue("Expected to find element in metadata table", tableIdsForMetadata.remove(entry.getKey().getColumnQualifier().toString()));
+    Assert.assertTrue("Expected to find two elements in metadata table, only found one ",
iter.hasNext());
+    entry = iter.next();
+    Assert.assertTrue("Expected to find element in metadata table", tableIdsForMetadata.remove(entry.getKey().getColumnQualifier().toString()));
+    Assert.assertFalse("Expected to only find two elements in metadata table", iter.hasNext());
+
+    // Should be creating these records in replication table from metadata table every second
+    Thread.sleep(5000);
 
     // Verify that we found two replication records: one for table1 and one for table2
     s = ReplicationTable.getScanner(conn, new Authorizations());
@@ -352,7 +368,7 @@ public class ReplicationTest extends ConfigurableMacIT {
     Assert.assertTrue("Found no records in replication table", iter.hasNext());
     entry = iter.next();
     Assert.assertTrue("Expected to find element in replication table", tableIds.remove(entry.getKey().getColumnQualifier().toString()));
-    Assert.assertTrue("Expected to find two elements in replication table, didn't find "
+ tableIds, iter.hasNext());
+    Assert.assertTrue("Expected to find two elements in replication table, only found one
", iter.hasNext());
     entry = iter.next();
     Assert.assertTrue("Expected to find element in replication table", tableIds.remove(entry.getKey().getColumnQualifier().toString()));
     Assert.assertFalse("Expected to only find two elements in replication table", iter.hasNext());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/856f2359/test/src/test/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
b/test/src/test/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
index d561d2f..b90d7f7 100644
--- a/test/src/test/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
@@ -648,7 +648,7 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacIT
{
       }
 
       log.info("Found {} records in {}", countTable, peerTable2);
-      Assert.assertTrue(countTable > 0);
+      Assert.assertTrue("Did not find any records in peer", countTable > 0);
 
     } finally {
       peer1Cluster.stop();


Mime
View raw message