hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From li...@apache.org
Subject svn commit: r1584167 - in /hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase: ./ client/ master/ regionserver/ util/
Date Wed, 02 Apr 2014 20:49:22 GMT
Author: liyin
Date: Wed Apr  2 20:49:22 2014
New Revision: 1584167

URL: http://svn.apache.org/r1584167
Log:
[master] Tag unstables

Author: daviddeng

Summary: https://our.intern.facebook.com/intern/wiki/index.php/HBase/UnstableTestcase

Test Plan: `mvn -Dtest=UnstableTestSuite test`

Reviewers: manukranthk, gauravm, aaiyer, liyintang, fan

Reviewed By: manukranthk

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D1229648

Task ID: 3789093

Modified:
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/UnstableTestSuite.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestHTableClientScanner.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestLogSplitOnMasterFailover.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerFileSystemFailure.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java?rev=1584167&r1=1584166&r2=1584167&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java Wed Apr
 2 20:49:22 2014
@@ -39,6 +39,8 @@ import org.apache.hadoop.hbase.client.Pu
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;
 import org.apache.hadoop.hbase.util.RuntimeExceptionAbortStrategy;
+import org.apache.hadoop.hbase.util.TagRunner;
+import org.apache.hadoop.hbase.util.TestTag;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.ZooKeeper;
@@ -46,7 +48,9 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
+@RunWith(TagRunner.class)
 public class TestZooKeeper {
   private final Log LOG = LogFactory.getLog(this.getClass());
 
@@ -89,6 +93,8 @@ public class TestZooKeeper {
    * @throws IOException
    * @throws InterruptedException
    */
+  // Marked as unstable and recorded at #2747689
+  @TestTag({ "unstable" })
   @Test (timeout = 300000)
   public void testClientSessionExpired()
       throws IOException, InterruptedException {
@@ -203,6 +209,9 @@ public class TestZooKeeper {
     assertNull(zkw.getData("/l1", "l2"));
   }
 
+
+  // Marked as unstable and recorded at #2747689
+  @TestTag({ "unstable" })
   @Test (timeout = 300000)
   public void testRegionServerSessionExpired() throws Exception{
     LOG.info("Starting testRegionServerSessionExpired");
@@ -218,8 +227,8 @@ public class TestZooKeeper {
     LOG.info("Starting testMasterSessionExpired");
     new HTable(conf, HConstants.META_TABLE_NAME);
     TEST_UTIL.expireMasterSession();
-    
-    List<RegionServerThread> regionServerThreadList = 
+
+    List<RegionServerThread> regionServerThreadList =
       TEST_UTIL.getHBaseCluster().getRegionServerThreads();
     for (RegionServerThread regionServerThread : regionServerThreadList) {
       regionServerThread.getRegionServer().kill();

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/UnstableTestSuite.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/UnstableTestSuite.java?rev=1584167&r1=1584166&r2=1584167&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/UnstableTestSuite.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/UnstableTestSuite.java Wed
Apr  2 20:49:22 2014
@@ -19,6 +19,7 @@
  */
 package org.apache.hadoop.hbase;
 
+import org.apache.hadoop.hbase.client.TestFromClientSide;
 import org.apache.hadoop.hbase.client.TestScannerTimeout;
 import org.apache.hadoop.hbase.client.TestServerConfigFromClient;
 import org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat;
@@ -27,10 +28,12 @@ import org.apache.hadoop.hbase.master.Te
 import org.apache.hadoop.hbase.master.TestRegionPlacement;
 import org.apache.hadoop.hbase.master.TestRegionStateOnMasterFailure;
 import org.apache.hadoop.hbase.regionserver.TestHRegionCloseRetry;
+import org.apache.hadoop.hbase.regionserver.TestHRegionServerFileSystemFailure;
 import org.apache.hadoop.hbase.regionserver.metrics.TestThriftMetrics;
 import org.apache.hadoop.hbase.regionserver.wal.TestLogRolling;
 import org.apache.hadoop.hbase.regionserver.wal.TestWALReplay;
 import org.apache.hadoop.hbase.replication.regionserver.TestReplicationSink;
+import org.apache.hadoop.hbase.util.TagRunner;
 import org.apache.hadoop.hbase.util.TestProcessBasedCluster;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
@@ -42,6 +45,8 @@ import org.junit.runners.Suite.SuiteClas
     TestProcessBasedCluster.class, TestRegionStateOnMasterFailure.class,
     TestScannerTimeout.class, TestWALReplay.class, TestThriftMetrics.class,
     TestRegionPlacement.class, TestServerConfigFromClient.class,
-    TestRSLivenessOnMasterFailover.class, TestLogSplitOnMasterFailover.class })
+    TestRSLivenessOnMasterFailover.class, TestLogSplitOnMasterFailover.class,
+    TagRunner.class, TestHRegionServerFileSystemFailure.class,
+    TestFromClientSide.class })
 public class UnstableTestSuite {
 }

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java?rev=1584167&r1=1584166&r2=1584167&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
Wed Apr  2 20:49:22 2014
@@ -75,18 +75,22 @@ import org.apache.hadoop.hbase.regionser
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.Store;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.TagRunner;
+import org.apache.hadoop.hbase.util.TestTag;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 /**
  * Run tests that use the HBase clients; {@link HTable} and {@link HTablePool}.
  * Sets up the HBase mini cluster once at start and runs through all client tests.
  * Each creates a table named for the method and does its stuff against that.
  */
+@RunWith(TagRunner.class)
 public class TestFromClientSide {
   final Log LOG = LogFactory.getLog(getClass());
   private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
@@ -137,42 +141,42 @@ public class TestFromClientSide {
     byte [] r2 = Bytes.toBytes("r12");
     byte[] value =  Bytes.toBytes("v");
     Result result1, result2;
-    
+
     HTable ht = TEST_UTIL.createTable(TABLE, FAMILIES);
     Put put = new Put(r1);
     put.add(FAMILY, null, value);
     ht.put(put);
-   
+
     Get.Builder g1 = new Get.Builder(r1);
     g1.addColumn(FAMILY, null);
     result1 = ht.get(g1.create());
-    
+
     Get.Builder g2 = new Get.Builder(r1);
     g2.addColumn(FAMILY, HConstants.EMPTY_BYTE_ARRAY);
     result2 = ht.get(g2.create());
-    
+
     assertEquals(result1.getBytes(), result2.getBytes());
     assertEquals(1, result2.raw().length);
     assertEquals(result1.raw().length, result2.raw().length);
-    
+
     put = new Put(r2);
     put.add(FAMILY, HConstants.EMPTY_BYTE_ARRAY, value);
     ht.put(put);
     ht.flushCommits();
-    
+
     g1 = new Get.Builder(r2);
     g1.addColumn(FAMILY, null);
     result1 = ht.get(g1.create());
-    
+
     g2 = new Get.Builder(r2);
     g2.addColumn(FAMILY, HConstants.EMPTY_BYTE_ARRAY);
     result2 = ht.get(g2.create());
-    
+
     assertEquals(result1.getBytes(), result2.getBytes());
     assertEquals(1, result2.raw().length);
     assertEquals(result1.raw().length, result2.raw().length);
   }
-  
+
   @Test
   public void testFlashBackTime() throws Exception {
     byte[] TABLE = Bytes.toBytes("testFlashBackTime");
@@ -734,6 +738,8 @@ public class TestFromClientSide {
    * we should get an exception instead of the server trying until
    * OOM.
    */
+  // Marked as unstable and recorded at #3925054
+  @TestTag({ "unstable" })
   @Test
   public void testResultLimits() throws Exception {
     // We want to set the max result size to something small
@@ -3535,7 +3541,7 @@ public class TestFromClientSide {
     }
   }
 
-  
+
   @Test
   public void testRowsPutMultiGet() throws IOException {
     final byte[] CONTENTS_FAMILY = Bytes.toBytes("contents");

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestHTableClientScanner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestHTableClientScanner.java?rev=1584167&r1=1584166&r2=1584167&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestHTableClientScanner.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestHTableClientScanner.java
Wed Apr  2 20:49:22 2014
@@ -31,6 +31,10 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+/**
+ * Testcase for HTableClientScanner.
+ * TODO daviddeng add some edge case explicitly.
+ */
 public class TestHTableClientScanner {
   final Log LOG = LogFactory.getLog(getClass());
 

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestLogSplitOnMasterFailover.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestLogSplitOnMasterFailover.java?rev=1584167&r1=1584166&r2=1584167&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestLogSplitOnMasterFailover.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestLogSplitOnMasterFailover.java
Wed Apr  2 20:49:22 2014
@@ -247,6 +247,8 @@ public class TestLogSplitOnMasterFailove
     runTest();
   }
 
+  // Marked as unstable and recored in 3376780
+  @TestTag({ "unstable" })
   @Test(timeout=180000)
   public void testWithDistributedLogSplitting() throws Exception {
     ZooKeeperWrapper.setNamespaceForTesting();

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerFileSystemFailure.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerFileSystemFailure.java?rev=1584167&r1=1584166&r2=1584167&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerFileSystemFailure.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerFileSystemFailure.java
Wed Apr  2 20:49:22 2014
@@ -15,10 +15,14 @@ import org.apache.hadoop.hbase.master.HM
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.HasThread;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;
+import org.apache.hadoop.hbase.util.TagRunner;
+import org.apache.hadoop.hbase.util.TestTag;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
+@RunWith(TagRunner.class)
 public class TestHRegionServerFileSystemFailure {
   private static final Log LOG = LogFactory
       .getLog(TestHRegionServerFileSystemFailure.class);
@@ -65,6 +69,8 @@ public class TestHRegionServerFileSystem
     }
   }
 
+  // Marked as unstable and recorded at #3297537
+  @TestTag({ "unstable" })
   @Test
   public void testHRegionServerFileSystemFailure() throws Exception {
     // Build some data.

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java?rev=1584167&r1=1584166&r2=1584167&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java Wed Apr
 2 20:49:22 2014
@@ -318,14 +318,14 @@ public class TestBytes extends TestCase 
     return list;
   }
 
-  public void testComparatorPerfRandom() {
+  public void testComparator() {
     // The rows in a given region follow the following pattern:
     // [PREFIX BYTES][ID BYTES]
-    // With long prefixes, the comparison using guava is faster.
-    // With fewer common bytes, the guava comparison is slower.
-    for (int PREFIX = 50; PREFIX >= 0; PREFIX -= 5) {
+    // With long prefixes, the comparison using Guava is faster.
+    // With fewer common bytes, the Guava comparison is slower.
+    for (int PREFIX = 50; PREFIX >= 0; PREFIX -= 10) {
       int ID = 100;
-      int numRows = 10000;
+      int numRows = 1000;
       List<byte[]> list = getRowsRandom(numRows, PREFIX, ID);
 
       // Correctness
@@ -335,37 +335,9 @@ public class TestBytes extends TestCase 
           int bg = Bytes.compareTo(list.get(i), list.get(j));
           Bytes.useGuavaBytesComparision = false;
           int bs = Bytes.compareTo(list.get(i), list.get(j));
-          assertTrue(bg == bs);
+          assertTrue(bg + " != " + bs, bg == bs);
         }
       }
-
-      // Comparing the Bytes
-      boolean[] bools = new boolean[]{true, false};
-      long[] timeNs = new long[2];
-
-      for (int idx = 0; idx < 2; idx++) {
-        Bytes.useGuavaBytesComparision = bools[idx];
-        long st = System.nanoTime();
-        for (int i=0; i<numRows; i++) {
-          for (int j=0; j<numRows; j++) {
-            Bytes.compareTo(list.get(i), list.get(j));
-          }
-        }
-        long en = System.nanoTime();
-        timeNs[idx] += (en - st);
-      }
-      double gain = (timeNs[1] - timeNs[0]) / ((double)timeNs[1]);
-      System.out.println("Prefix : " + PREFIX + ", gain : " + gain * 100 + " ");
-      if (PREFIX > 20) {
-        assertTrue(gain > 0.1);
-        assertTrue(timeNs[1] > timeNs[0]);
-      } else if (PREFIX < 10) {
-        assertTrue(gain < -0.1);
-        if (PREFIX == 0) {
-          assertTrue(gain < -0.5);
-        }
-        assertTrue(timeNs[1] < timeNs[0]);
-      }
     }
   }
 }



Mime
View raw message