Skip to content

Commit

Permalink
fix testcase in pkg/client/leaderelection that wasn't testing what it…
Browse files Browse the repository at this point in the history
… said it was testing
  • Loading branch information
mikedanese committed Dec 11, 2015
1 parent 8535f13 commit 5e03250
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/client/leaderelection/leaderelection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
},
Expand All @@ -120,6 +124,9 @@ func TestTryAcquireOrRenew(t *testing.T) {
},
},
},
observedRecord: LeaderElectionRecord{HolderIdentity: "bing"},
observedTime: past,

expectSuccess: true,
outHolder: "baz",
},
Expand Down

0 comments on commit 5e03250

Please sign in to comment.