"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "staging/src/k8s.io/legacy-cloud-providers/azure/azure_cache_test.go" between
kubernetes-1.15.9.tar.gz and kubernetes-1.15.10.tar.gz

About: Kubernetes is a platform for automating deployment, scaling, and operations of application containers across clusters of hosts (written in "Go"). 1.15.x series.

azure_cache_test.go  (kubernetes-1.15.9):azure_cache_test.go  (kubernetes-1.15.10)
skipping to change at line 205 skipping to change at line 205
wg.Add(1) wg.Add(1)
go cache.Get(key, cacheReadTypeDefault) go cache.Get(key, cacheReadTypeDefault)
wg.Done() wg.Done()
} }
v, err := cache.Get(key, cacheReadTypeDefault) v, err := cache.Get(key, cacheReadTypeDefault)
wg.Wait() wg.Wait()
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, 1, dataSource.called) assert.Equal(t, 1, dataSource.called)
assert.Equal(t, val, v, "cache should get correct data") assert.Equal(t, val, v, "cache should get correct data")
} }
func TestCacheForceRefresh(t *testing.T) {
key := "key1"
val := &fakeDataObj{}
data := map[string]*fakeDataObj{
key: val,
}
dataSource, cache := newFakeCache(t)
dataSource.set(data)
v, err := cache.Get(key, cacheReadTypeDefault)
assert.NoError(t, err)
assert.Equal(t, 1, dataSource.called)
assert.Equal(t, val, v, "cache should get correct data")
v, err = cache.Get(key, cacheReadTypeForceRefresh)
assert.NoError(t, err)
assert.Equal(t, 2, dataSource.called)
assert.Equal(t, val, v, "should refetch unexpired data as forced refresh"
)
}
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)