forked from mtusi2026/mtusi2026lab7
lab7: безопасность, mTLS, OpenBao и PKI lifecycle
This commit is contained in:
@@ -5,6 +5,7 @@ package postgres_test
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@@ -31,14 +32,16 @@ func TestCachePerformanceExperiment(t *testing.T) {
|
||||
redisConfig := cache.RedisConfig{
|
||||
Host: envOr("TEST_REDIS_HOST", "localhost"),
|
||||
Port: envInt("TEST_REDIS_PORT", 6379),
|
||||
Password: envOr("TEST_REDIS_PASSWORD", ""),
|
||||
DB: envInt("TEST_REDIS_DB", 2),
|
||||
Username: envOr("TEST_REDIS_USERNAME", "operator"),
|
||||
Password: os.Getenv("TEST_REDIS_PASSWORD"),
|
||||
DB: envInt("TEST_REDIS_DB", 7),
|
||||
DialTimeout: 5 * time.Second,
|
||||
ReadTimeout: 3 * time.Second,
|
||||
WriteTimeout: 3 * time.Second,
|
||||
PoolSize: 10,
|
||||
}
|
||||
redisCache, err := cache.NewRedis(redisConfig)
|
||||
require.NotZero(t, redisConfig.DB, "cache experiment must not use production redis db 0")
|
||||
redisCache, err := cache.NewRedis(ctx, redisConfig)
|
||||
require.NoError(t, err)
|
||||
defer func() { _ = redisCache.Close() }()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user