MCPcopy
hub / github.com/kubernetes/client-go / TestReflectorStopWatch

Function TestReflectorStopWatch

tools/cache/reflector_test.go:197–208  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

195}
196
197func TestReflectorStopWatch(t *testing.T) {
198 s := NewStore(MetaNamespaceKeyFunc)
199 g := NewReflector(&testLW{}, &v1.Pod{}, s, 0)
200 fw := watch.NewFake()
201 var resumeRV string
202 stopWatch := make(chan struct{}, 1)
203 stopWatch <- struct{}{}
204 err := g.watchHandler(fw, &resumeRV, nevererrc, stopWatch)
205 if err != errorStopRequested {
206 t.Errorf("expected stop error, got %q", err)
207 }
208}
209
210func TestReflectorListAndWatch(t *testing.T) {
211 createdFakes := make(chan *watch.FakeWatcher)

Callers

nothing calls this directly

Calls 4

watchHandlerMethod · 0.95
NewStoreFunction · 0.85
NewReflectorFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected