Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 fc733bd31 -> d3d50338e


HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce 
flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)


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

Branch: refs/heads/branch-1.3
Commit: d3d50338e742bc7b2e6fbd73cc48d176d8f24409
Parents: fc733bd
Author: Stephen Yuan Jiang <syuanjiang...@gmail.com>
Authored: Wed May 18 07:12:29 2016 -0700
Committer: Stephen Yuan Jiang <syuanjiang...@gmail.com>
Committed: Wed May 18 09:10:11 2016 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/util/TestHBaseFsck.java | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d3d50338/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
index 343f2a9..6b7c304 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
@@ -2575,20 +2575,26 @@ public class TestHBaseFsck {
     Threads.sleep(300); // wait some more to ensure writeLock.acquire() is 
called
 
     hbck = doFsck(conf, false);
-    assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK}); // 
still one expired, one not-expired
+    // still one expired, one not-expired
+    assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK});
 
     edge.incrementTime(conf.getLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT,
         TableLockManager.DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS)); // let table 
lock expire
 
     hbck = doFsck(conf, false);
-    assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK, 
ERROR_CODE.EXPIRED_TABLE_LOCK}); // both are expired
-
-    conf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1); // reaping 
from ZKInterProcessWriteLock uses znode cTime,
-                                                                 // which is 
not injectable through EnvironmentEdge
+    // both are expired
+    assertErrors(
+      hbck,
+      new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK, 
ERROR_CODE.EXPIRED_TABLE_LOCK});
+
+    Configuration localConf = new Configuration(conf);
+    // reaping from ZKInterProcessWriteLock uses znode cTime,
+    // which is not injectable through EnvironmentEdge
+    localConf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1);
     Threads.sleep(10);
-    hbck = doFsck(conf, true); // now fix both cases
+    hbck = doFsck(localConf, true); // now fix both cases
 
-    hbck = doFsck(conf, false);
+    hbck = doFsck(localConf, false);
     assertNoErrors(hbck);
 
     // ensure that locks are deleted

Reply via email to