accumulo-commits mailing list archives

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

Branch: refs/heads/master
Commit: 2f02d69d79dbfd5c5ca6aaa2c97bddc6317bd3c2
Parents: e81eee7
Author: Josh Elser <elserj@apache.org>
Authored: Tue Jun 3 22:03:34 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Tue Jun 3 22:03:34 2014 -0400

----------------------------------------------------------------------
 .../test/replication/ReplicationIT.java         | 23 ++++++++----
 .../test/replication/ReplicationTest.java       |  6 ++--
 .../UnorderedWorkAssignerReplicationIT.java     | 37 ++++++++++++++------
 3 files changed, 45 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/2f02d69d/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 db21586..d051e75 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
@@ -403,7 +403,7 @@ public class ReplicationIT extends ConfigurableMacIT {
     }
   }
 
-  @Test(timeout = 60 * 5000)
+  @Test(timeout = 10 * 60 * 1000)
   public void dataWasReplicatedToThePeerWithoutDrain() throws Exception {
     MiniAccumuloConfigImpl peerCfg = new MiniAccumuloConfigImpl(createTestDir(this.getClass().getName()
+ "_" + this.testName.getMethodName() + "_peer"),
         ROOT_PASSWORD);
@@ -626,14 +626,23 @@ public class ReplicationIT 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));
+      for (int i = 0; i < 10; i++) {
+        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 (0l == countTable) {
+          Thread.sleep(5000);
+        } else {
+          break;
+        }
       }
 
-      log.info("Found {} records in {}", countTable, peerTable1);
-      Assert.assertTrue(countTable > 0);
+      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))
{

http://git-wip-us.apache.org/repos/asf/accumulo/blob/2f02d69d/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 51e4e46..04d1d6e 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
@@ -94,8 +94,8 @@ public class ReplicationTest extends ConfigurableMacIT {
   @Override
   public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
     // Run the master replication loop run frequently
-    cfg.setProperty(Property.MASTER_REPLICATION_SCAN_INTERVAL, "0");
-    cfg.setProperty(Property.REPLICATION_WORK_ASSIGNMENT_SLEEP, "0s");
+    cfg.setProperty(Property.MASTER_REPLICATION_SCAN_INTERVAL, "1s");
+    cfg.setProperty(Property.REPLICATION_WORK_ASSIGNMENT_SLEEP, "1s");
     cfg.setProperty(Property.TSERV_WALOG_MAX_SIZE, "1M");
     cfg.setProperty(Property.GC_CYCLE_START, "1s");
     cfg.setProperty(Property.GC_CYCLE_DELAY, "0");
@@ -1302,7 +1302,7 @@ public class ReplicationTest extends ConfigurableMacIT {
           }
         }
 
-        Thread.sleep(1000);
+        Thread.sleep(2000);
       }
 
       if (notFound) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/2f02d69d/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 17c8179..6c21962 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
@@ -370,23 +370,38 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacIT
{
       connMaster.replicationOperations().drain(masterTable2, filesFor2);
 
       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));
+      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 (masterTable1Records != countTable) {
+          log.warn("Did not find {} expected records in {}, only found {}", masterTable1Records,
peerTable1, countTable);
+        }
       }
 
-      log.info("Found {} records in {}", countTable, peerTable1);
       Assert.assertEquals(masterTable1Records, countTable);
 
-      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);
+
+        if (masterTable2Records != countTable) {
+          log.warn("Did not find {} expected records in {}, only found {}", masterTable2Records,
peerTable2, countTable);
+        }
       }
 
-      log.info("Found {} records in {}", countTable, peerTable2);
       Assert.assertEquals(masterTable2Records, countTable);
 
     } finally {


Mime
View raw message