INNER CODE UNIT · Go
func
VersusControl/versus-incident · cmd/main_test.go:119
func (source *healthSource) Name() string { return source.name }
func (source *healthSource) Pull(context.Context, time.Time) ([]core.Signal, time.Time, error) {
return nil, time.Time{}, nil
}
// TestNewRedisClientClusterType verifies that enabling cluster mode builds a
// cluster-aware client (*redis.ClusterClient) rather than a single-node one.
// The cluster client is what parses the Redis 7 / Valkey CLUSTER SLOTS reply
// (which carries a 4th per-node metadata element) correctly, so cursor
// persistence keeps working against ElastiCache in cluster mode instead of
// falling back to in-memory. Both concrete clients are threaded as the shared
// redis.UniversalClient interface, which the assertions below also confirm.
func TestNewRedisClientClusterType(t *testing.T) {
tru := true
fls := false
t.Run("cluster enabled returns *redis.ClusterClient", func(t *testing.T) {
client := newRedisClient(c.RedisConfig{Host: "localhost", Port: 6379, TLS: &fls, Cluster: &tru})