Use watch.Deleted event on the endpoints to ensure we do a valid transition
Deleted -> Added instead of Modified -> Added.
Otherwise the event queue code panics and kills the cache reflector
goroutine which causes events to never be delivered to the test router process.
fixes
@@ -369,9 +369,7 @@ func TestRouter(t *testing.T) {
//clean up
routeEvent.Type = watch.Deleted
- endpointEvent.Type = watch.Modified
- endpoints := endpointEvent.Object.(*kapi.Endpoints)
- endpoints.Subsets = []kapi.EndpointSubset{}
+ endpointEvent.Type = watch.Deleted
sendTimeout(t, fakeMasterAndPod.EndpointChannel, eventString(endpointEvent), 30*time.Second)
sendTimeout(t, fakeMasterAndPod.RouteChannel, eventString(routeEvent), 30*time.Second)
