Commit 06421d5f authored by Jeff Lowdermilk's avatar Jeff Lowdermilk

Merge pull request #18589 from mikedanese/leader-test

fix testcase in pkg/client/leaderelection that wasn't testing what it said it was testing
parents c103825e 5e032505
......@@ -35,6 +35,7 @@ import (
func TestTryAcquireOrRenew(t *testing.T) {
future := time.Now().Add(1000 * time.Hour)
past := time.Now().Add(-1000 * time.Hour)
tests := []struct {
observedRecord LeaderElectionRecord
......@@ -109,6 +110,9 @@ func TestTryAcquireOrRenew(t *testing.T) {
ObjectMeta: api.ObjectMeta{
Namespace: action.GetNamespace(),
Name: action.(testclient.GetAction).GetName(),
Annotations: map[string]string{
LeaderElectionRecordAnnotationKey: `{"holderIdentity":"bing"}`,
},
},
}, nil
},
......@@ -120,6 +124,9 @@ func TestTryAcquireOrRenew(t *testing.T) {
},
},
},
observedRecord: LeaderElectionRecord{HolderIdentity: "bing"},
observedTime: past,
expectSuccess: true,
outHolder: "baz",
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment