Skip to content

Commit 6c8db4c

Browse files
committed
wip
Signed-off-by: wind57 <[email protected]>
1 parent f3ee5d8 commit 6c8db4c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

spring-cloud-kubernetes-fabric8-leader/src/test/java/org/springframework/cloud/kubernetes/fabric8/leader/election/it/Fabric8LeaderElectionSimpleITTest.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import static org.assertj.core.api.Assertions.assertThat;
4545

4646
/**
47-
* A very simple test where we are the sole participant in the leader
47+
* A simple test where we are the sole participant in the leader
4848
* election and everything goes fine from start to end. It's a happy path
4949
* scenario test.
5050
*
@@ -99,10 +99,14 @@ void test(CapturedOutput output) {
9999
assertThat(output.getOut()).contains(
100100
"Attempting to acquire leader lease 'LeaseLock: default - spring-k8s-leader-election-lock (simple-it)'");
101101

102-
// 4. we are the leader (comes from our code)
102+
// 4. lease has been acquired
103+
assertThat(output.getOut()).contains(
104+
"Acquired lease 'LeaseLock: default - spring-k8s-leader-election-lock (simple-it)'");
105+
106+
// 5. we are the leader (comes from our code)
103107
assertThat(output.getOut()).contains("Leader changed from null to simple-it");
104108

105-
// 5. wait until a renewal happens (comes from fabric code)
109+
// 6. wait until a renewal happens (comes from fabric code)
106110
// this one means that we have extended our leadership
107111
Awaitility.await()
108112
.atMost(Duration.ofSeconds(15))
@@ -112,11 +116,10 @@ void test(CapturedOutput output) {
112116

113117

114118

119+
120+
115121
//
116-
// Lease lockLease = kubernetesClient.leases()
117-
// .inNamespace("default")
118-
// .withName("spring-k8s-leader-election-lock")
119-
// .get();
122+
120123
// ZonedDateTime currentAcquiredTime = lockLease.getSpec().getAcquireTime();
121124
// Assertions.assertThat(currentAcquiredTime).isNotNull();
122125
// Assertions.assertThat(lockLease.getSpec().getLeaseDurationSeconds()).isEqualTo(15);

0 commit comments

Comments
 (0)