Merge pull request #1966 from nwt/fix-redis-tests
Fix connection pool exhaustion in Redis testspull/1972/head
commit
431cfa3179
|
@ -26,7 +26,7 @@ func TestRedisBlobDescriptorCacheProvider(t *testing.T) {
|
||||||
|
|
||||||
if redisAddr == "" {
|
if redisAddr == "" {
|
||||||
// skip if still not set
|
// skip if still not set
|
||||||
t.Skip("please set -registry.storage.cache.redis to test layer info cache against redis")
|
t.Skip("please set -test.registry.storage.cache.redis.addr to test layer info cache against redis")
|
||||||
}
|
}
|
||||||
|
|
||||||
pool := &redis.Pool{
|
pool := &redis.Pool{
|
||||||
|
@ -43,9 +43,11 @@ func TestRedisBlobDescriptorCacheProvider(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the database
|
// Clear the database
|
||||||
if _, err := pool.Get().Do("FLUSHDB"); err != nil {
|
conn := pool.Get()
|
||||||
|
if _, err := conn.Do("FLUSHDB"); err != nil {
|
||||||
t.Fatalf("unexpected error flushing redis db: %v", err)
|
t.Fatalf("unexpected error flushing redis db: %v", err)
|
||||||
}
|
}
|
||||||
|
conn.Close()
|
||||||
|
|
||||||
cachecheck.CheckBlobDescriptorCache(t, NewRedisBlobDescriptorCacheProvider(pool))
|
cachecheck.CheckBlobDescriptorCache(t, NewRedisBlobDescriptorCacheProvider(pool))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue