Repository: accumulo Updated Branches: refs/heads/master 672801c15 -> 643aaed80
ACCUMULO-2913 More replication test stabilization. Remove commented code, retry some checks for replication data a few times before failing the test, and remove the defaultTimeoutSeconds because it was overriding what was actually configured in the JUnit timeout annotation. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/643aaed8 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/643aaed8 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/643aaed8 Branch: refs/heads/master Commit: 643aaed80039f870a247f8c8e167152fd8b52b76 Parents: 672801c Author: Josh Elser <els...@apache.org> Authored: Wed Jun 18 08:42:24 2014 -0700 Committer: Josh Elser <els...@apache.org> Committed: Wed Jun 18 08:44:46 2014 -0700 ---------------------------------------------------------------------- .../test/replication/ReplicationIT.java | 5 --- .../UnorderedWorkAssignerReplicationIT.java | 45 +++++++++++++------- 2 files changed, 29 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/643aaed8/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java b/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java index cf9f3bf..4abe25a 100644 --- a/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java +++ b/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java @@ -89,11 +89,6 @@ public class ReplicationIT extends ConfigurableMacIT { private static final Logger log = LoggerFactory.getLogger(ReplicationIT.class); @Override - public int defaultTimeoutSeconds() { - return 30; - } - - @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { // Run the master replication loop run frequently cfg.setProperty(Property.MASTER_REPLICATION_SCAN_INTERVAL, "1s"); http://git-wip-us.apache.org/repos/asf/accumulo/blob/643aaed8/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 558c75f..8977754 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 @@ -610,8 +610,6 @@ public class UnorderedWorkAssignerReplicationIT 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; @@ -631,24 +629,39 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacIT { Assert.assertNotEquals(0, fullyReplicated); long countTable = 0l; - for (Entry<Key,Value> entry : connPeer.createScanner(peerTable1, Authorizations.EMPTY)) { - countTable++; - Assert.assertTrue("Found unexpected key-value" + entry.getKey().toStringNoTruncate() + " " + entry.getValue(), entry.getKey().getRow().toString() - .startsWith(masterTable1)); + + // Check a few times + for (int i = 0; i < 5; i++) { + countTable = 0l; + for (Entry<Key,Value> entry : connPeer.createScanner(peerTable1, Authorizations.EMPTY)) { + countTable++; + Assert.assertTrue("Found unexpected key-value" + entry.getKey().toStringNoTruncate() + " " + entry.getValue(), entry.getKey().getRow().toString() + .startsWith(masterTable1)); + } + log.info("Found {} records in {}", countTable, peerTable1); + if (0 < countTable) { + break; + } + Thread.sleep(2000); } - log.info("Found {} records in {}", countTable, peerTable1); - Assert.assertTrue(countTable > 0); + Assert.assertTrue("Did not find any records in " + peerTable1 + " on peer", 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)); - } + for (int i = 0; i < 5; 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); - Assert.assertTrue("Did not find any records in peer", countTable > 0); + log.info("Found {} records in {}", countTable, peerTable2); + if (0 < countTable) { + break; + } + Thread.sleep(2000); + } + Assert.assertTrue("Did not find any records in " + peerTable2 + " on peer", countTable > 0); } finally { peer1Cluster.stop();