Clean up RedisLockRegistryLeaderInitiatorTests
Related to https://build.spring.io/browse/INT-MASTERSPRING40-1129 When there is no other candidates in the cluster, the current `yield()` will give a leadership to the current active initiator back Therefore a `revoke()` might not be called at all * Fir the `RedisLockRegistryLeaderInitiatorTests` to check revoking after `stop()` instead of `yield()`
This commit is contained in:
@@ -129,12 +129,10 @@ public class RedisLockRegistryLeaderInitiatorTests extends RedisAvailableTests {
|
||||
initiator1.setLeaderEventPublisher(new CountingPublisher(new CountDownLatch(1), revoked11,
|
||||
new CountDownLatch(1)));
|
||||
|
||||
initiator1.getContext().yield();
|
||||
initiator1.stop();
|
||||
|
||||
assertThat(revoked11.await(60, TimeUnit.SECONDS)).isTrue();
|
||||
assertThat(initiator1.getContext().isLeader()).isFalse();
|
||||
|
||||
initiator1.stop();
|
||||
}
|
||||
|
||||
private static class CountingPublisher implements LeaderEventPublisher {
|
||||
|
||||
Reference in New Issue
Block a user