Fix grammar in comments and add missing `expectedMaxItems` to let it
break fast. Signed-off-by: Yecheng Fu <cofyc.jackson@gmail.com>
This commit is contained in:
parent
d73b0d3141
commit
3a253f796c
|
@ -189,8 +189,9 @@ func requireTargetGroups(t *testing.T, expected, res map[string]*targetgroup.Gro
|
|||
}
|
||||
|
||||
type hasSynced interface {
|
||||
// hasSynced returns true if all informers' store has synced.
|
||||
// This is only used in testing to determine when the cache stores have synced.
|
||||
// hasSynced returns true if all informers synced.
|
||||
// This is only used in testing to determine when discoverer synced to
|
||||
// kubernetes apiserver.
|
||||
hasSynced() bool
|
||||
}
|
||||
|
||||
|
|
|
@ -163,6 +163,7 @@ func TestPodDiscoveryAdd(t *testing.T) {
|
|||
c.CoreV1().Pods(obj.Namespace).Create(obj)
|
||||
w.Pods().Add(obj)
|
||||
},
|
||||
expectedMaxItems: 1,
|
||||
expectedRes: map[string]*targetgroup.Group{
|
||||
"pod/default/testpod": {
|
||||
Targets: []model.LabelSet{
|
||||
|
@ -200,6 +201,7 @@ func TestPodDiscoveryDelete(t *testing.T) {
|
|||
c.CoreV1().Pods(obj.Namespace).Delete(obj.Name, &metav1.DeleteOptions{})
|
||||
w.Pods().Delete(obj)
|
||||
},
|
||||
expectedMaxItems: 2,
|
||||
expectedRes: map[string]*targetgroup.Group{
|
||||
"pod/default/testpod": {
|
||||
Source: "pod/default/testpod",
|
||||
|
@ -244,6 +246,7 @@ func TestPodDiscoveryUpdate(t *testing.T) {
|
|||
c.CoreV1().Pods(obj.Namespace).Create(obj)
|
||||
w.Pods().Modify(obj)
|
||||
},
|
||||
expectedMaxItems: 2,
|
||||
expectedRes: map[string]*targetgroup.Group{
|
||||
"pod/default/testpod": {
|
||||
Targets: []model.LabelSet{
|
||||
|
|
Loading…
Reference in New Issue