kube-apiserver/leaderelection/tests: fix test case PingTime should be ahead of RenewTime

This commit is contained in:
Jefftree 2024-07-27 15:17:28 +00:00
parent b8045f98a4
commit f173f0c58c

View File

@ -174,7 +174,7 @@ func TestReconcileElectionStep(t *testing.T) {
LeaseName: "component-A",
EmulationVersion: "1.20.0",
BinaryVersion: "1.20.0",
PingTime: ptr.To(metav1.NewMicroTime(fakeClock.Now())),
PingTime: ptr.To(metav1.NewMicroTime(fakeClock.Now().Add(-1 * time.Millisecond))),
RenewTime: ptr.To(metav1.NewMicroTime(fakeClock.Now())),
PreferredStrategies: []v1.CoordinatedLeaseStrategy{v1.OldestEmulationVersion},
},