Repository: kylin
Updated Branches:
  refs/heads/KYLIN-2578 5a8a1f291 -> e2baef471


fix UT


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

Branch: refs/heads/KYLIN-2578
Commit: e2baef47105e885f2fb828a53a7238e3475a87b1
Parents: 5a8a1f2
Author: Yang Li <[email protected]>
Authored: Sat May 6 23:39:27 2017 +0800
Committer: Yang Li <[email protected]>
Committed: Sat May 6 23:39:27 2017 +0800

----------------------------------------------------------------------
 .../kylin/storage/hbase/util/ZookeeperDistributedLockTest.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/e2baef47/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/util/ZookeeperDistributedLockTest.java
----------------------------------------------------------------------
diff --git 
a/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/util/ZookeeperDistributedLockTest.java
 
b/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/util/ZookeeperDistributedLockTest.java
index b544f6c..6065e0f 100644
--- 
a/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/util/ZookeeperDistributedLockTest.java
+++ 
b/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/util/ZookeeperDistributedLockTest.java
@@ -64,6 +64,8 @@ public class ZookeeperDistributedLockTest extends 
HBaseMetadataTestCase {
         assertTrue(l.lock(path));
         assertTrue(l.lock(path));
         assertEquals(l.getClient(), l.peekLock(path));
+        assertTrue(l.isLocked(path));
+        assertTrue(l.isLockedByMe(path));
         l.unlock(path);
         assertTrue(l.isLocked(path) == false);
     }
@@ -125,7 +127,7 @@ public class ZookeeperDistributedLockTest extends 
HBaseMetadataTestCase {
     public void testWatch() throws InterruptedException, IOException {
         // init lock paths
         final String base = 
"/kylin/test/ZookeeperDistributedLockTest/testWatch/" + rand();
-        final int nLocks = 3;
+        final int nLocks = 4;
         final String[] lockPaths = new String[nLocks];
         for (int i = 0; i < nLocks; i++)
             lockPaths[i] = base + "/" + (i + 1);
@@ -221,6 +223,7 @@ public class ZookeeperDistributedLockTest extends 
HBaseMetadataTestCase {
 
                 // random unlock
                 try {
+                    lockIdx = rand.nextInt(nLocks);
                     client.unlock(lockPaths[lockIdx]);
                 } catch (IllegalStateException e) {
                     // ignore

Reply via email to