You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2013/11/15 20:48:27 UTC

[2/5] git commit: ACCUMULO-1890 Clean up the test to avoid spinning up a MAC

ACCUMULO-1890 Clean up the test to avoid spinning up a MAC


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 7e23cf2854387a3b27d460a174e12eb0f40bfe0d
Parents: 4119611
Author: Josh Elser <el...@apache.org>
Authored: Fri Nov 15 11:26:30 2013 -0800
Committer: Josh Elser <el...@apache.org>
Committed: Fri Nov 15 11:30:31 2013 -0800

----------------------------------------------------------------------
 .../minicluster/MiniAccumuloClusterGCTest.java  | 23 +++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7e23cf28/src/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
----------------------------------------------------------------------
diff --git a/src/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java b/src/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
index b73523f..d58eb47 100644
--- a/src/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
+++ b/src/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
@@ -30,9 +30,8 @@ import org.apache.commons.io.filefilter.SuffixFileFilter;
 import org.apache.commons.io.filefilter.TrueFileFilter;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
-import org.junit.AfterClass;
 import org.junit.Assert;
-import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
@@ -43,12 +42,26 @@ import com.google.common.collect.ImmutableMap;
  */
 public class MiniAccumuloClusterGCTest {
   
+  @Test
+  public void testGcConfig() throws Exception {
+
+    MiniAccumuloConfig macConfig = new MiniAccumuloConfig(tmpDir.getRoot(), passwd);
+    macConfig.setNumTservers(1);
+
+    Assert.assertEquals(false, macConfig.shouldRunGC());
+    
+    // Turn on the garbage collector
+    macConfig.runGC(true);
+
+    Assert.assertEquals(true, macConfig.shouldRunGC());
+  }
+
+  
   private static TemporaryFolder tmpDir = new TemporaryFolder();
   private static MiniAccumuloConfig macConfig;
   private static MiniAccumuloCluster accumulo;
   private static final String passwd = "password";
   
-  @BeforeClass
   public static void setupMiniCluster() throws Exception {
     tmpDir.create();
     Logger.getLogger("org.apache.zookeeper").setLevel(Level.ERROR);
@@ -69,13 +82,13 @@ public class MiniAccumuloClusterGCTest {
     accumulo.start();
   }
   
-  @AfterClass
   public static void tearDownMiniCluster() throws Exception {
     accumulo.stop();
     tmpDir.delete();
   }
   
-  @Test(timeout = 20000)
+  // This test seems to be a little too unstable for a unit test
+  @Ignore
   public void test() throws Exception {
     ZooKeeperInstance inst = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers());
     Connector c = inst.getConnector("root", passwd);