hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject hbase git commit: HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)
Date Wed, 18 May 2016 20:22:58 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 5ac54e6ab -> 8aa8abfcb


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/8aa8abfc
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8aa8abfc
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8aa8abfc

Branch: refs/heads/master
Commit: 8aa8abfcb672e4b905c487a10f1511db431f7006
Parents: 5ac54e6
Author: Stephen Yuan Jiang <syuanjiangdev@gmail.com>
Authored: Wed May 18 09:41:13 2016 -0700
Committer: Stephen Yuan Jiang <syuanjiangdev@gmail.com>
Committed: Wed May 18 13:22:41 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/util/TestHBaseFsckOneRS.java       | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/8aa8abfc/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
index 165fea6..57bc77e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
@@ -1472,7 +1472,8 @@ public class TestHBaseFsckOneRS extends BaseTestHBaseFsck {
         TableLockManager.DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS)); // let table lock expire
 
     hbck = doFsck(conf, false);
-    assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] {HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK});
+    assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] {
+        HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK});
 
     final CountDownLatch latch = new CountDownLatch(1);
     new Thread() {
@@ -1496,24 +1497,27 @@ public class TestHBaseFsckOneRS extends BaseTestHBaseFsck {
     Threads.sleep(300); // wait some more to ensure writeLock.acquire() is called
 
     hbck = doFsck(conf, false);
+    // still one expired, one not-expired
     assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] {
-        HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK}); // still one expired, one
not-expired
+        HBaseFsck.ErrorReporter.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 HBaseFsck.ErrorReporter.ERROR_CODE[] {HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK,
+    assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] {
+        HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK,
         HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK}); // both are expired
 
-    conf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1);
+    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


Mime
View raw message