accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [46/51] [abbrv] git commit: ACCUMULO-378 More test stabilization
Date Sat, 14 Jun 2014 04:55:46 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/264fad8e
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/264fad8e
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/264fad8e

Branch: refs/heads/master
Commit: 264fad8eb304246214bb3eee4df981f92de9a2e3
Parents: 3a4cb95
Author: Josh Elser <elserj@apache.org>
Authored: Sun Jun 8 14:33:55 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Sun Jun 8 14:33:55 2014 -0400

----------------------------------------------------------------------
 .../test/replication/ReplicationTest.java       | 23 +++++++++++++-------
 1 file changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/264fad8e/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 a9b8b74..2421c7f 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
@@ -346,17 +346,24 @@ public class ReplicationTest extends ConfigurableMacIT {
     Set<String> tableIds = Sets.newHashSet(conn.tableOperations().tableIdMap().get(table1),
conn.tableOperations().tableIdMap().get(table2));
     Set<String> tableIdsForMetadata = Sets.newHashSet(tableIds);
 
+    Thread.sleep(2000);
+
     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());
+    List<Entry<Key,Value>> records = new ArrayList<>();
+    for (Entry<Key,Value> metadata : s) {
+      records.add(metadata);
+    }
+
+    Assert.assertEquals("Expected to find 2 records, but actually found " + records, 2, records.size());
+
+    for (Entry<Key,Value> metadata : records) {
+      Assert.assertTrue("Expected record to be in metadata but wasn't " + metadata.getKey().toStringNoTruncate()
+ ", tableIds remaining " + tableIdsForMetadata,
+          tableIdsForMetadata.remove(metadata.getKey().getColumnQualifier().toString()));
+    }
+
+    Assert.assertTrue("Expected that we had removed all metadata entries " + tableIdsForMetadata,
tableIdsForMetadata.isEmpty());
 
     // Should be creating these records in replication table from metadata table every second
     Thread.sleep(5000);


Mime
View raw message