Increase timeouts for RedisLockLeaderInitTests
* `setBusyWaitMillis(10000)` before yielding to let another candidate to lock * Add `Thread.sleep(100);` before yielding
This commit is contained in:
@@ -102,7 +102,9 @@ public class RedisLockRegistryLeaderInitiatorTests extends RedisAvailableTests {
|
||||
initiator2.setLeaderEventPublisher(new CountingPublisher(granted2, revoked2, acquireLockFailed2));
|
||||
|
||||
// It's hard to see round-robin election, so let's make the yielding initiator to sleep long before restarting
|
||||
initiator1.setBusyWaitMillis(1000);
|
||||
initiator1.setBusyWaitMillis(10000);
|
||||
|
||||
Thread.sleep(100);
|
||||
|
||||
initiator1.getContext().yield();
|
||||
|
||||
@@ -113,7 +115,9 @@ public class RedisLockRegistryLeaderInitiatorTests extends RedisAvailableTests {
|
||||
assertThat(initiator1.getContext().isLeader()).isFalse();
|
||||
|
||||
initiator1.setBusyWaitMillis(LockRegistryLeaderInitiator.DEFAULT_BUSY_WAIT_TIME);
|
||||
initiator2.setBusyWaitMillis(1000);
|
||||
initiator2.setBusyWaitMillis(10000);
|
||||
|
||||
Thread.sleep(100);
|
||||
|
||||
initiator2.getContext().yield();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user