Repository: hbase Updated Branches: refs/heads/branch-1.1 ce6f111a3 -> 55212d531
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/55212d53 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/55212d53 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/55212d53 Branch: refs/heads/branch-1.1 Commit: 55212d53139d197e1fd499592c2ff9a390ed60c5 Parents: ce6f111 Author: Stephen Yuan Jiang <[email protected]> Authored: Wed May 18 07:12:29 2016 -0700 Committer: Stephen Yuan Jiang <[email protected]> Committed: Wed May 18 07:12:29 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/55212d53/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 04ee249..3731a51 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 @@ -2465,20 +2465,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
