mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Change test cases to verify the client sends the received resourceVersion
This commit is contained in:
parent
82bcdd3b3b
commit
a5462c0678
10
pkg/client/cache/reflector_test.go
vendored
10
pkg/client/cache/reflector_test.go
vendored
@ -92,8 +92,8 @@ func TestReflector_watchHandler(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// RV should stay 1 higher than the last id we see.
|
||||
if e, a := "33", resumeRV; e != a {
|
||||
// RV should send the last version we see.
|
||||
if e, a := "32", resumeRV; e != a {
|
||||
t.Errorf("expected %v, got %v", e, a)
|
||||
}
|
||||
}
|
||||
@ -102,9 +102,9 @@ func TestReflector_listAndWatch(t *testing.T) {
|
||||
createdFakes := make(chan *watch.FakeWatcher)
|
||||
|
||||
// The ListFunc says that it's at revision 1. Therefore, we expect our WatchFunc
|
||||
// to get called at the beginning of the watch with 1, and again with 4 when we
|
||||
// inject an error at 3.
|
||||
expectedRVs := []string{"1", "4"}
|
||||
// to get called at the beginning of the watch with 1, and again with 3 when we
|
||||
// inject an error.
|
||||
expectedRVs := []string{"1", "3"}
|
||||
lw := &testLW{
|
||||
WatchFunc: func(rv string) (watch.Interface, error) {
|
||||
fw := watch.NewFake()
|
||||
|
@ -66,7 +66,7 @@ func TestServices(t *testing.T) {
|
||||
fakeWatch.Stop()
|
||||
|
||||
newFakeWatch.Add(&service)
|
||||
if !reflect.DeepEqual(fakeClient.Actions, []client.FakeAction{{"watch-services", "1"}, {"watch-services", "3"}}) {
|
||||
if !reflect.DeepEqual(fakeClient.Actions, []client.FakeAction{{"watch-services", "1"}, {"watch-services", "2"}}) {
|
||||
t.Errorf("expected call to watch-endpoints, got %#v", fakeClient)
|
||||
}
|
||||
}
|
||||
@ -191,7 +191,7 @@ func TestEndpoints(t *testing.T) {
|
||||
fakeWatch.Stop()
|
||||
|
||||
newFakeWatch.Add(&endpoint)
|
||||
if !reflect.DeepEqual(fakeClient.Actions, []client.FakeAction{{"watch-endpoints", "1"}, {"watch-endpoints", "3"}}) {
|
||||
if !reflect.DeepEqual(fakeClient.Actions, []client.FakeAction{{"watch-endpoints", "1"}, {"watch-endpoints", "2"}}) {
|
||||
t.Errorf("expected call to watch-endpoints, got %#v", fakeClient)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user