Remove unused cacheKey helper and testcontainers imports, simplify Redis container setup

This commit is contained in:
mlsmaycon
2026-04-21 16:17:31 +02:00
parent 5d58000dbd
commit 3716838c25
2 changed files with 1 additions and 15 deletions

View File

@@ -8,9 +8,7 @@ import (
"github.com/redis/go-redis/v9"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/testcontainers/testcontainers-go"
testcontainersredis "github.com/testcontainers/testcontainers-go/modules/redis"
"github.com/testcontainers/testcontainers-go/wait"
)
func TestParseFastPathFlag(t *testing.T) {
@@ -130,12 +128,7 @@ func setupFastPathRedisContainer(t *testing.T) (string, *redis.Client) {
t.Helper()
ctx := context.Background()
redisContainer, err := testcontainersredis.RunContainer(ctx,
testcontainers.WithImage("redis:7"),
testcontainers.WithWaitStrategy(
wait.ForListeningPort("6379/tcp"),
),
)
redisContainer, err := testcontainersredis.Run(ctx, "redis:7")
require.NoError(t, err, "create redis test container")
t.Cleanup(func() {

View File

@@ -3,7 +3,6 @@ package grpc
import (
"context"
"encoding/json"
"fmt"
"time"
"github.com/eko/gocache/lib/v4/cache"
@@ -81,9 +80,3 @@ func (c *PeerSerialCache) Delete(pubKey string) {
log.Debugf("peer serial cache: delete entry for %s: %v", pubKey, err)
}
}
// cacheKey exposes the namespaced key for tests that need to peek at the raw
// storage, e.g. when asserting TTL behaviour against Redis.
func (c *PeerSerialCache) cacheKey(pubKey string) string {
return fmt.Sprintf("%s%s", peerSerialCacheKeyPrefix, pubKey)
}