From 6ffdd5eee39c50d87aa915a53d49d7f5069f0636 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Tue, 23 Aug 2016 11:01:47 -0400 Subject: [PATCH] ZkLockRegistryTests: increase tryLock timeout https://build.spring.io/browse/INT-AT42SIO-253/ ``` java.lang.AssertionError: Should have been able to lock with zookeeper server restarted! at org.junit.Assert.fail(Assert.java:88) at org.junit.Assert.assertTrue(Assert.java:41) at org.springframework.integration.zookeeper.lock.ZkLockRegistryTests.voidLockFailsWhenServerDown(ZkLockRegistryTests.java:339) ``` When we do `testingServer.restart();` we should give more time to let it started on background, therefore increase the next `lock2.tryLock()` to 10 seconds. **Cherry-pick to 4.3.x and 4.2.x** --- .../integration/zookeeper/lock/ZkLockRegistryTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/lock/ZkLockRegistryTests.java b/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/lock/ZkLockRegistryTests.java index 491bbfcd77..4405a7eab8 100644 --- a/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/lock/ZkLockRegistryTests.java +++ b/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/lock/ZkLockRegistryTests.java @@ -337,7 +337,7 @@ public class ZkLockRegistryTests extends ZookeeperTestSupport { testingServer.restart(); assertTrue("Should have been able to lock with zookeeper server restarted!", - lock2.tryLock(1, TimeUnit.SECONDS)); + lock2.tryLock(10, TimeUnit.SECONDS)); assertTrue("Should have still held lock1", lock1.tryLock(1, TimeUnit.SECONDS));