mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-03 08:04:45 +00:00
Fixed a harmless bug where initialPopulationCount should be based on the key length not list size in DeltaFIFO#Replace()
Kubernetes-commit: bc39672c0638426979feef95baeff39d170161eb
This commit is contained in:
committed by
Kubernetes Publisher
parent
50c086135a
commit
1d175299a2
9
tools/cache/delta_fifo_test.go
vendored
9
tools/cache/delta_fifo_test.go
vendored
@@ -633,6 +633,15 @@ func TestDeltaFIFO_HasSynced(t *testing.T) {
|
||||
},
|
||||
expectedSynced: true,
|
||||
},
|
||||
{
|
||||
// This test case won't happen in practice since a Reflector, the only producer for delta_fifo today, always passes a complete snapshot consistent in time;
|
||||
// there cannot be duplicate keys in the list or apiserver is broken.
|
||||
actions: []func(f *DeltaFIFO){
|
||||
func(f *DeltaFIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("a", 2)}, "0") },
|
||||
func(f *DeltaFIFO) { Pop(f) },
|
||||
},
|
||||
expectedSynced: true,
|
||||
},
|
||||
}
|
||||
|
||||
for i, test := range tests {
|
||||
|
Reference in New Issue
Block a user