accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [2/2] git commit: ACCUMULO-1215 stabilize integration tests
Date Fri, 27 Sep 2013 17:41:08 GMT
ACCUMULO-1215 stabilize integration tests


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

Branch: refs/heads/master
Commit: 9ac95f86986a01dfb55ecfdaa1ed3776d2150501
Parents: e5e5b2b
Author: Eric Newton <eric.newton@gmail.com>
Authored: Fri Sep 27 13:41:15 2013 -0400
Committer: Eric Newton <eric.newton@gmail.com>
Committed: Fri Sep 27 13:41:15 2013 -0400

----------------------------------------------------------------------
 .../minicluster/MiniAccumuloCluster.java        | 17 +++++++++++--
 pom.xml                                         |  1 -
 .../accumulo/server/util/TServerUtils.java      |  2 +-
 .../apache/accumulo/test/functional/BulkIT.java |  2 +-
 .../accumulo/test/functional/ExamplesIT.java    | 26 ++++++++++++--------
 .../accumulo/test/functional/LargeRowIT.java    |  2 +-
 .../accumulo/test/functional/RenameIT.java      |  2 +-
 .../accumulo/test/functional/RestartIT.java     |  4 +--
 .../accumulo/test/functional/ShutdownIT.java    |  2 +-
 .../test/functional/SparseColumnFamilyIT.java   |  2 +-
 .../accumulo/test/functional/ZooCacheIT.java    |  2 +-
 test/src/test/resources/log4j.properties        |  3 ++-
 12 files changed, 42 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
index 8805570..77776df 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.InetSocketAddress;
+import java.net.Socket;
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -264,7 +265,7 @@ public class MiniAccumuloCluster {
 
     File siteFile = new File(config.getConfDir(), "accumulo-site.xml");
     writeConfig(siteFile, config.getSiteConfig().entrySet());
-
+    
     FileWriter fileWriter = new FileWriter(siteFile);
     fileWriter.append("<configuration>\n");
 
@@ -343,7 +344,19 @@ public class MiniAccumuloCluster {
 
     if (!initialized) {
       // sleep a little bit to let zookeeper come up before calling init, seems to work better
-      UtilWaitThread.sleep(250);
+      while (true) {
+        try {
+          Socket s = new Socket("localhost", config.getZooKeeperPort());
+          s.getOutputStream().write("ruok\n".getBytes());
+          s.getOutputStream().flush();
+          byte buffer[] = new byte[100];
+          int n = s.getInputStream().read(buffer);
+          if (n == 4 && new String(buffer, 0, n).equals("imok"))
+            break;
+        } catch (Exception e) {
+          UtilWaitThread.sleep(250);
+        }
+      }
       Process initProcess = exec(Initialize.class, "--instance-name", config.getInstanceName(),
"--password", config.getRootPassword());
       int ret = initProcess.waitFor();
       if (ret != 0) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 62aa809..ae871c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -108,7 +108,6 @@
   </distributionManagement>
   <properties>
     <accumulo.it.forkCount>1</accumulo.it.forkCount>
-    <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 -->

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/server/src/main/java/org/apache/accumulo/server/util/TServerUtils.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/util/TServerUtils.java b/server/src/main/java/org/apache/accumulo/server/util/TServerUtils.java
index fd052c0..1df17fe 100644
--- a/server/src/main/java/org/apache/accumulo/server/util/TServerUtils.java
+++ b/server/src/main/java/org/apache/accumulo/server/util/TServerUtils.java
@@ -298,7 +298,7 @@ public class TServerUtils {
   public static ServerAddress startTServer(HostAndPort address, TimedProcessor processor,
String serverName, String threadName, int numThreads, long timeBetweenThreadChecks, long maxMessageSize)
       throws TTransportException {
     ServerAddress result = startHsHaServer(address, processor, serverName, threadName, numThreads,
timeBetweenThreadChecks, maxMessageSize);
-    // ServerPort result = startThreadPoolServer(port, processor, serverName, threadName,
-1);
+    //ServerAddress result = startThreadPoolServer(address, processor, serverName, threadName,
-1);
     final TServer finalServer = result.server;
     Runnable serveTask = new Runnable() {
       public void run() {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
index 1ad3fe4..607f2a5 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
@@ -30,7 +30,7 @@ public class BulkIT extends SimpleMacIT {
   static final int N = 100000;
   static final int COUNT = 5;
   
-  @Test(timeout = 2 * 60 * 1000)
+  @Test(timeout = 4 * 60 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
     String tableName = makeTableName();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
index af2107a..87729e1 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
@@ -169,16 +169,22 @@ public class ExamplesIT extends ConfigurableMacIT {
         keepers, "-u", user, "-p", ROOT_PASSWORD, "--num", "100000", "--min", "0", "--max",
"1000000000", "--size", "50",
         "--batchMemmory", "2M", "--batchLatency", "60s", "--batchThreads", "3", "-t", "bloom_test").waitFor());
     c.tableOperations().flush("bloom_test", null, null, true);
-    long now = System.currentTimeMillis();
-    assertEquals(0,  cluster.exec(RandomBatchScanner.class,"--seed", "7", "-i", instance,
"-z",
-        keepers, "-u", user, "-p", ROOT_PASSWORD, "--num", "10000", "--min", "0", "--max",
"1000000000", "--size", "50",
-        "--scanThreads", "4","-t", "bloom_test").waitFor());
-    long diff = System.currentTimeMillis() - now;
-    now = System.currentTimeMillis();
-    assertEquals(0,  cluster.exec(RandomBatchScanner.class,"--seed", "8", "-i", instance,
"-z",
-        keepers, "-u", user, "-p", ROOT_PASSWORD, "--num", "10000", "--min", "0", "--max",
"1000000000", "--size", "50",
-        "--scanThreads", "4","-t", "bloom_test").waitFor());
-    long diff2 = System.currentTimeMillis() - now;
+    long diff = 0, diff2 = 0;
+    // try the speed test a couple times in case the system is loaded with other tests
+    for (int i = 0; i < 2; i++) {
+      long now = System.currentTimeMillis();
+      assertEquals(0,  cluster.exec(RandomBatchScanner.class,"--seed", "7", "-i", instance,
"-z",
+          keepers, "-u", user, "-p", ROOT_PASSWORD, "--num", "10000", "--min", "0", "--max",
"1000000000", "--size", "50",
+          "--scanThreads", "4","-t", "bloom_test").waitFor());
+      diff = System.currentTimeMillis() - now;
+      now = System.currentTimeMillis();
+      assertEquals(0,  cluster.exec(RandomBatchScanner.class,"--seed", "8", "-i", instance,
"-z",
+          keepers, "-u", user, "-p", ROOT_PASSWORD, "--num", "10000", "--min", "0", "--max",
"1000000000", "--size", "50",
+          "--scanThreads", "4","-t", "bloom_test").waitFor());
+      diff2 = System.currentTimeMillis() - now;
+      if (diff2 < diff)
+        break;
+    }
     assertTrue(diff2 < diff);
     
     log.info("Creating a sharded index of the accumulo java files");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java b/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
index 9493e43..0ef134a 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
@@ -53,7 +53,7 @@ public class LargeRowIT extends ConfigurableMacIT {
   private static final int NUM_PRE_SPLITS = 9;
   private static final int SPLIT_THRESH = ROW_SIZE * NUM_ROWS / NUM_PRE_SPLITS;
   
-  @Test(timeout = 2 * 60 * 1000)
+  @Test(timeout = 4 * 60 * 1000)
   public void run() throws Exception {
     Random r = new Random();
     byte rowData[] = new byte[ROW_SIZE];

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/test/src/test/java/org/apache/accumulo/test/functional/RenameIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RenameIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RenameIT.java
index 0758695..ff8d894 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/RenameIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/RenameIT.java
@@ -25,7 +25,7 @@ import org.junit.Test;
 
 public class RenameIT extends SimpleMacIT {
   
-  @Test(timeout = 60 * 1000)
+  @Test(timeout = 2 * 60 * 1000)
   public void renameTest() throws Exception {
     String name1 = makeTableName();
     String name2 = makeTableName();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java
index 1567d7b..de29d3b 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java
@@ -71,7 +71,7 @@ public class RestartIT extends ConfigurableMacIT {
     ingest.destroy();
   }
   
-  @Test(timeout = 4 * 60 * 1000)
+  @Test(timeout = 8 * 60 * 1000)
   public void restartMasterRecovery() throws Exception {
     Connector c = getConnector();
     c.tableOperations().create("test_ingest");
@@ -108,7 +108,7 @@ public class RestartIT extends ConfigurableMacIT {
     ingest.destroy();
   }
   
-  @Test(timeout = 2 * 60 * 1000)
+  @Test(timeout = 100 * 60 * 1000)
   public void killedTabletServer() throws Exception {
     Connector c = getConnector();
     c.tableOperations().create("test_ingest");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/test/src/test/java/org/apache/accumulo/test/functional/ShutdownIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ShutdownIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ShutdownIT.java
index d60eba6..8d58821 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ShutdownIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ShutdownIT.java
@@ -59,7 +59,7 @@ public class ShutdownIT extends ConfigurableMacIT {
   }
 
   
-  @Test(timeout = 60 * 1000)
+  @Test(timeout = 2 * 60 * 1000)
   public void shutdownDuringDeleteTable() throws Exception {
     final Connector c = getConnector();
     for (int i = 0; i < 10 ; i++) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
b/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
index 8b7a83a..c45a6a3 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
@@ -36,7 +36,7 @@ import org.junit.Test;
  */
 public class SparseColumnFamilyIT extends SimpleMacIT {
   
-  @Test(timeout = 30 * 1000)
+  @Test(timeout = 60 * 1000)
   public void sparceColumnFamily() throws Exception {
     String scftt = makeTableName();
     Connector c = getConnector();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
index 44db530..f4f4964 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
@@ -44,7 +44,7 @@ public class ZooCacheIT extends SimpleMacIT {
       reader.start();
       threads.add(reader);
     }
-    assertEquals(0, exec(CacheTestWriter.class, "/zcTest-42", "/tmp/zcTest-42", "3","500").waitFor());
+    assertEquals(0, exec(CacheTestWriter.class, "/zcTest-42", "/tmp/zcTest-42", "3","50").waitFor());
     for (Thread t: threads) {
       t.join();
       if (ref.get() != null)

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9ac95f86/test/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/test/src/test/resources/log4j.properties b/test/src/test/resources/log4j.properties
index fa7ea02..277822a 100644
--- a/test/src/test/resources/log4j.properties
+++ b/test/src/test/resources/log4j.properties
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-log4j.rootLogger=INFO, CA
+log4j.rootLogger=DEBUG, CA
 log4j.appender.CA=org.apache.log4j.ConsoleAppender
 log4j.appender.CA.layout=org.apache.log4j.PatternLayout
 log4j.appender.CA.layout.ConversionPattern=%d{ISO8601} [%c{2}] %-5p: %m%n
@@ -29,3 +29,4 @@ log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR
 log4j.logger.org.apache.hadoop.util.ProcessTree=WARN
 log4j.logger.org.apache.zookeeper.ClientCnxn=FATAL
 log4j.logger.org.apache.zookeeper.ZooKeeper=WARN
+log4j.logger.org.apache.accumulo.core.file.rfile.bcfile=INFO


Mime
View raw message