You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by ma...@apache.org on 2014/11/20 03:11:18 UTC

incubator-aurora git commit: Fixing flaky LockManager test.

Repository: incubator-aurora
Updated Branches:
  refs/heads/master 065a3c5c8 -> 6d06d8639


Fixing flaky LockManager test.

Bugs closed: AURORA-798

Reviewed at https://reviews.apache.org/r/28066/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/6d06d863
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/6d06d863
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/6d06d863

Branch: refs/heads/master
Commit: 6d06d8639a92b8be034a0ee0b1815ea318508e35
Parents: 065a3c5
Author: Maxim Khutornenko <ma...@apache.org>
Authored: Wed Nov 19 18:11:00 2014 -0800
Committer: Maxim Khutornenko <ma...@apache.org>
Committed: Wed Nov 19 18:11:00 2014 -0800

----------------------------------------------------------------------
 .../aurora/scheduler/state/LockManagerImplTest.java       | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6d06d863/src/test/java/org/apache/aurora/scheduler/state/LockManagerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/state/LockManagerImplTest.java b/src/test/java/org/apache/aurora/scheduler/state/LockManagerImplTest.java
index 6e499d1..953fb9e 100644
--- a/src/test/java/org/apache/aurora/scheduler/state/LockManagerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/state/LockManagerImplTest.java
@@ -38,7 +38,6 @@ import org.apache.aurora.scheduler.storage.testing.StorageTestUtil;
 import org.easymock.EasyMock;
 import org.easymock.IAnswer;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
@@ -164,12 +163,13 @@ public class LockManagerImplTest extends EasyMockTest {
 
   // Test for regression of AURORA-702.
   @Test
-  @Ignore("Flaky test - see https://issues.apache.org/jira/browse/AURORA-798")
   public void testNoDeadlock() throws Exception {
     final StorageTestUtil storageUtil = new StorageTestUtil(this);
 
-    expect(storageUtil.storeProvider.getLockStore()).andReturn(storageUtil.lockStore).times(2);
-    expect(storageUtil.lockStore.fetchLock(LOCK_KEY)).andReturn(Optional.<ILock>absent()).times(2);
+    expect(storageUtil.storeProvider.getLockStore()).andReturn(storageUtil.lockStore).atLeastOnce();
+    expect(storageUtil.lockStore.fetchLock(LOCK_KEY))
+        .andReturn(Optional.<ILock>absent())
+        .atLeastOnce();
 
     final CountDownLatch reads = new CountDownLatch(2);
     EasyMock.makeThreadSafe(storageUtil.storage, false);
@@ -184,7 +184,7 @@ public class LockManagerImplTest extends EasyMockTest {
             reads.await();
             return result;
           }
-        }).times(2);
+        }).atLeastOnce();
 
     lockManager = new LockManagerImpl(storageUtil.storage, clock, tokenGenerator);