accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [14/50] git commit: ACCUMULO-1537 make tests more stable, document in pom how to run tests in parallel
Date Tue, 23 Jul 2013 16:54:39 GMT
ACCUMULO-1537 make tests more stable, document in pom how to run tests in parallel


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

Branch: refs/heads/ACCUMULO-1000
Commit: f7e96a3e7174eb56a4eb21f7dfdf1f6a9495cc0e
Parents: f4c6e6f
Author: Eric Newton <eric.newton@gmail.com>
Authored: Wed Jul 17 12:11:24 2013 -0400
Committer: Eric Newton <eric.newton@gmail.com>
Committed: Wed Jul 17 12:11:24 2013 -0400

----------------------------------------------------------------------
 .../minicluster/MiniAccumuloConfig.java         |  1 +
 pom.xml                                         |  4 +++
 .../test/functional/DynamicThreadPoolsIT.java   | 29 ++++++++++----------
 .../accumulo/test/functional/MacTest.java       |  2 +-
 .../accumulo/test/functional/SplitIT.java       |  8 ++++--
 5 files changed, 26 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7e96a3e/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java
b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java
index f183b4e..600ea4b 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java
@@ -121,6 +121,7 @@ public class MiniAccumuloConfig {
       mergePropWithRandomPort(Property.TRACE_PORT.getKey());
       mergePropWithRandomPort(Property.TSERV_CLIENTPORT.getKey());
       mergePropWithRandomPort(Property.MONITOR_PORT.getKey());
+      mergePropWithRandomPort(Property.GC_PORT.getKey());
       
       // zookeeper port should be set explicitly in this class, not just on the site config
       if (zooKeeperPort == null)

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7e96a3e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 73f8454..edcaa16 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,6 +107,7 @@
     </site>
   </distributionManagement>
   <properties>
+    <accumulo.it.threads>1</accumulo.it.threads>
     <!-- used for filtering the java source with the current version -->
     <accumulo.release.version>${project.version}</accumulo.release.version>
     <!-- the maven-release-plugin makes this recommendation, due to plugin bugs -->
@@ -667,6 +668,9 @@
               <goal>verify</goal>
             </goals>
             <configuration>
+              <!--parallel>classes</parallel-->
+              <perCoreThreadCount>false</perCoreThreadCount>
+              <threadCount>${accumulo.it.threads}</threadCount> 
               <redirectTestOutputToFile>true</redirectTestOutputToFile>
             </configuration>
           </execution>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7e96a3e/test/src/test/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
b/test/src/test/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
index d954974..daced3e 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.test.functional;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 import java.util.Collections;
 
@@ -40,30 +40,28 @@ public class DynamicThreadPoolsIT extends MacTest {
   
   @Override
   public void configure(MiniAccumuloConfig cfg) {
+    cfg.setNumTservers(1);
     cfg.setSiteConfig(Collections.singletonMap(Property.TSERV_MAJC_DELAY.getKey(), "100ms"));
   }
   
-  @Test(timeout = 30 * 1000)
+  @Test(timeout = 60 * 1000)
   public void test() throws Exception {
+    final int TABLES = 15;
     Connector c = getConnector();
-    c.instanceOperations().setProperty(Property.TSERV_MAJC_MAXCONCURRENT.getKey(), "1");
+    c.instanceOperations().setProperty(Property.TSERV_MAJC_MAXCONCURRENT.getKey(), "5");
     TestIngest.Opts opts = new TestIngest.Opts();
     opts.rows = 100*1000;
     opts.createTable = true;
     TestIngest.ingest(c, opts, BWOPTS);
     c.tableOperations().flush("test_ingest", null, null, true);
-    c.tableOperations().clone("test_ingest", "test_ingest2", true, null, null);
-    c.tableOperations().clone("test_ingest", "test_ingest3", true, null, null);
-    c.tableOperations().clone("test_ingest", "test_ingest4", true, null, null);
-    c.tableOperations().clone("test_ingest", "test_ingest5", true, null, null);
-    c.tableOperations().clone("test_ingest", "test_ingest6", true, null, null);
-    
+    for (int i = 1; i < TABLES; i++)
+      c.tableOperations().clone("test_ingest", "test_ingest" + i, true, null, null);
+    UtilWaitThread.sleep(11*1000); // time between checks of the thread pool sizes
     TCredentials creds = CredentialHelper.create("root", new PasswordToken(MacTest.PASSWORD),
c.getInstance().getInstanceName());
-    UtilWaitThread.sleep(10);
-    for (int i = 2; i < 7; i++)
+    for (int i = 1; i < TABLES; i++)
       c.tableOperations().compact("test_ingest" + i, null, null, true, false);
-    int count = 0;
-    while (count == 0) {
+    for (int i = 0; i < 30; i++) {
+      int count = 0;
       MasterClientService.Iface client = null;
       MasterMonitorInfo stats = null;
       try {
@@ -79,9 +77,10 @@ public class DynamicThreadPoolsIT extends MacTest {
         }
       }
       System.out.println("count " + count);
+      if (count > 3)
+        return;
       UtilWaitThread.sleep(1000);
     }
-    assertTrue(count == 1 || count == 2); // sometimes we get two threads due to the way
the stats are pulled
+    fail("Could not observe higher number of threads after changing the config");
   }
-  
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7e96a3e/test/src/test/java/org/apache/accumulo/test/functional/MacTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MacTest.java b/test/src/test/java/org/apache/accumulo/test/functional/MacTest.java
index a52d629..622702f 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MacTest.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MacTest.java
@@ -44,7 +44,7 @@ public class MacTest {
   @Before
   public void setUp() throws Exception {
     folder.create();
-    MiniAccumuloConfig cfg = new MiniAccumuloConfig(folder.newFolder("miniAccumulo"), PASSWORD);
+    MiniAccumuloConfig cfg = new MiniAccumuloConfig(folder.newFolder(this.getClass().getSimpleName()),
PASSWORD);
     configure(cfg);
     cluster = new MiniAccumuloCluster(cfg);
     cluster.start();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7e96a3e/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java b/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java
index 1be04b1..afb14d8 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java
@@ -103,8 +103,12 @@ public class SplitIT extends MacTest {
     c.tableOperations().setProperty("test_ingest", Property.TABLE_SPLIT_THRESHOLD.getKey(),
"10K");
     DeleteIT.deleteTest(c, cluster);
     c.tableOperations().flush("test_ingest", null, null, true);
-    UtilWaitThread.sleep(10*1000);
-    assertTrue(c.tableOperations().listSplits("test_ingest").size() > 30);
+    for (int i = 0; i < 5; i++) {
+      UtilWaitThread.sleep(10*1000);
+      if (c.tableOperations().listSplits("test_ingest").size() > 20)
+        break;
+    }
+    assertTrue(c.tableOperations().listSplits("test_ingest").size() > 20);
   }
   
 }


Mime
View raw message