code.onehippo.org is currently readonly. We are migrating to code.bloomreach.com, please continue working there on Monday 14/12. See: https://docs.bloomreach.com/display/engineering/GitLab

Commit 84858ae4 authored by Ard Schrijvers's avatar Ard Schrijvers

REPO-1811 fix unit tests

parent ab46d905
...@@ -336,7 +336,8 @@ public class LockManagerBasicTest extends AbstractLockManagerTest { ...@@ -336,7 +336,8 @@ public class LockManagerBasicTest extends AbstractLockManagerTest {
try (Log4jInterceptor interceptor = Log4jInterceptor.onWarn().trap(MemoryLockManager.class, DbLockManager.class).build()) { try (Log4jInterceptor interceptor = Log4jInterceptor.onWarn().trap(MemoryLockManager.class, DbLockManager.class).build()) {
lockManager.clear(); lockManager.clear();
assertTrue(interceptor.messages().anyMatch(m -> m.contains("Lock 'a' owned by '"+getClusterNodeId(session)+"' was never"))); assertTrue(interceptor.messages().anyMatch(m -> m.contains("Lock 'a' owned by cluster '"+getClusterNodeId(session)+
"' and thread '"+Thread.currentThread().getName()+"' was never")));
} }
dbRowAssertion("a", "FREE"); dbRowAssertion("a", "FREE");
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package org.onehippo.repository.lock; package org.onehippo.repository.lock;
import java.util.function.Consumer;
import javax.jcr.Session; import javax.jcr.Session;
import org.junit.After; import org.junit.After;
...@@ -85,7 +87,8 @@ public class LockManagerDestroyTest extends AbstractLockManagerTest { ...@@ -85,7 +87,8 @@ public class LockManagerDestroyTest extends AbstractLockManagerTest {
lockManager.destroy(); lockManager.destroy();
assertTrue("Lock Manager destroy was expected to take at least 10 seconds to wait for all interrupted threads " + assertTrue("Lock Manager destroy was expected to take at least 10 seconds to wait for all interrupted threads " +
"holding a lock to #unlock", (System.currentTimeMillis() - start ) >= 10_000); "holding a lock to #unlock", (System.currentTimeMillis() - start ) >= 10_000);
assertTrue(interceptor.messages().anyMatch(m -> m.contains("Lock '123' owned by '"+getClusterNodeId(session)+"' was never unlocked. Removing the lock now."))); assertTrue(interceptor.messages().anyMatch(m -> m.contains("Lock '123' owned by cluster '"+getClusterNodeId(session)+
"' and thread '"+unstoppableLockThread.getName()+"' was never unlocked. Removing the lock now.")));
} }
assertTrue("Thread containing lock 123 should had been interrupted ", unstoppable.interrupted); assertTrue("Thread containing lock 123 should had been interrupted ", unstoppable.interrupted);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment