Fix watch test to expect Expired instead of Gone

This commit is contained in:
Joe Betz 2019-11-05 22:06:10 -08:00
parent e2fe126d48
commit 57b451cfb6

View File

@ -444,8 +444,8 @@ func TestWatch(t *testing.T) {
} }
defer tooOldWatcher.Stop() defer tooOldWatcher.Stop()
// Ensure we get a "Gone" error // Ensure we get a "Gone" error
expectedGoneError := errors.NewGone("").ErrStatus expectedResourceExpiredError := errors.NewResourceExpired("").ErrStatus
verifyWatchEvent(t, tooOldWatcher, watch.Error, &expectedGoneError) verifyWatchEvent(t, tooOldWatcher, watch.Error, &expectedResourceExpiredError)
initialWatcher, err := cacher.Watch(context.TODO(), "pods/ns/foo", fooCreated.ResourceVersion, storage.Everything) initialWatcher, err := cacher.Watch(context.TODO(), "pods/ns/foo", fooCreated.ResourceVersion, storage.Everything)
if err != nil { if err != nil {
@ -668,8 +668,8 @@ func TestEmptyWatchEventCache(t *testing.T) {
t.Fatalf("Unexpected error: %v", err) t.Fatalf("Unexpected error: %v", err)
} }
defer watcher.Stop() defer watcher.Stop()
expectedGoneError := errors.NewGone("").ErrStatus expectedResourceExpiredError := errors.NewResourceExpired("").ErrStatus
verifyWatchEvent(t, watcher, watch.Error, &expectedGoneError) verifyWatchEvent(t, watcher, watch.Error, &expectedResourceExpiredError)
} }
{ {