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

Function TestDeltaFIFO_UpdateResyncRace

tools/cache/delta_fifo_test.go:305–325  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

303}
304
305func TestDeltaFIFO_UpdateResyncRace(t *testing.T) {
306 f := NewDeltaFIFO(
307 testFifoObjectKeyFunc,
308 keyLookupFunc(func() []testFifoObject {
309 return []testFifoObject{mkFifoObj("foo", 5)}
310 }),
311 )
312 f.Update(mkFifoObj("foo", 6))
313 f.Resync()
314
315 expectedList := []Deltas{
316 {{Updated, mkFifoObj("foo", 6)}},
317 }
318
319 for _, expected := range expectedList {
320 cur := Pop(f).(Deltas)
321 if e, a := expected, cur; !reflect.DeepEqual(e, a) {
322 t.Errorf("Expected %#v, got %#v", e, a)
323 }
324 }
325}
326
327func TestDeltaFIFO_HasSyncedCorrectOnDeletion(t *testing.T) {
328 f := NewDeltaFIFO(

Callers

nothing calls this directly

Calls 7

UpdateMethod · 0.95
ResyncMethod · 0.95
NewDeltaFIFOFunction · 0.85
keyLookupFuncFuncType · 0.85
mkFifoObjFunction · 0.85
PopFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected