diff --git a/tests/RedisConfigs/.docker/Envoy/envoy.yaml b/tests/RedisConfigs/.docker/Envoy/envoy.yaml index b950d5c4b..fe57c8c1f 100644 --- a/tests/RedisConfigs/.docker/Envoy/envoy.yaml +++ b/tests/RedisConfigs/.docker/Envoy/envoy.yaml @@ -1,17 +1,9 @@ admin: - access_log_path: "/dev/null" - address: - socket_address: - protocol: TCP - address: 0.0.0.0 - port_value: 8001 + address: { socket_address: { protocol: TCP, address: 0.0.0.0, port_value: 8001 } } static_resources: listeners: - name: redis_listener - address: - socket_address: - address: 0.0.0.0 - port_value: 7015 + address: { socket_address: { protocol: TCP, address: 0.0.0.0, port_value: 7015 } } filter_chains: - filters: - name: envoy.filters.network.redis_proxy @@ -19,22 +11,25 @@ static_resources: "@type": type.googleapis.com/envoy.extensions.filters.network.redis_proxy.v3.RedisProxy stat_prefix: envoy_redis_stats settings: - op_timeout: 5s - enable_redirection: true + op_timeout: 3s + dns_cache_config: + name: dynamic_forward_proxy_cache_config + dns_lookup_family: V4_ONLY prefix_routes: catch_all_route: - cluster: cluster_redis + cluster: redis_cluster clusters: - - name: cluster_redis - connect_timeout: 1s + - name: redis_cluster + connect_timeout: 3s type: STRICT_DNS dns_lookup_family: V4_ONLY load_assignment: - cluster_name: cluster_redis - endpoints: - - lb_endpoints: - - endpoint: - address: - socket_address: - address: host.docker.internal - port_value: 7000 + cluster_name: redis_cluster + endpoints: + - lb_endpoints: + - endpoint: { address: { socket_address: { address: redis, port_value: 7000 } } } + - endpoint: { address: { socket_address: { address: redis, port_value: 7001 } } } + - endpoint: { address: { socket_address: { address: redis, port_value: 7002 } } } + - endpoint: { address: { socket_address: { address: redis, port_value: 7003 } } } + - endpoint: { address: { socket_address: { address: redis, port_value: 7004 } } } + - endpoint: { address: { socket_address: { address: redis, port_value: 7005 } } } \ No newline at end of file diff --git a/tests/RedisConfigs/docker-compose.yml b/tests/RedisConfigs/docker-compose.yml index 50c1acda2..88e6386d2 100644 --- a/tests/RedisConfigs/docker-compose.yml +++ b/tests/RedisConfigs/docker-compose.yml @@ -9,10 +9,10 @@ services: image: stackexchange/redis-tests:latest platform: linux ports: - - 6379-6384:6379-6384 - - 7000-7006:7000-7006 - - 7010-7011:7010-7011 - - 26379-26381:26379-26381 + - 6379-6384:6379-6384 # Misc + - 7000-7006:7000-7006 # Cluster + - 7010-7011:7010-7011 # Sentinel Controllers + - 26379-26381:26379-26381 # Sentinel Data sysctls : net.core.somaxconn: '511' envoy: @@ -20,7 +20,11 @@ services: context: .docker/Envoy image: stackexchange/redis-tests-envoy:latest platform: linux - healthcheck: - test: ["CMD-SHELL", "redis-cli -p 7015 ping | grep PONG"] + environment: + loglevel: warning + depends_on: + redis: + condition: service_started ports: - - 7015:7015 + - 7015:7015 # Cluster + - 8001:8001 # Admin diff --git a/tests/StackExchange.Redis.Tests/Helpers/Attributes.cs b/tests/StackExchange.Redis.Tests/Helpers/Attributes.cs index 1fab56cbb..ab0583764 100644 --- a/tests/StackExchange.Redis.Tests/Helpers/Attributes.cs +++ b/tests/StackExchange.Redis.Tests/Helpers/Attributes.cs @@ -251,16 +251,14 @@ public static IEnumerable Expand(this ITestMethod testMethod, Fu { protocols = RunPerProtocol.AllProtocols; } - var results = new List(); foreach (var protocol in protocols) { - results.Add(generator(protocol)); + yield return generator(protocol); } - return results; } else { - return new[] { generator(RedisProtocol.Resp2) }; + yield return generator(RedisProtocol.Resp2); } } } @@ -270,7 +268,7 @@ public static IEnumerable Expand(this ITestMethod testMethod, Fu /// and with another culture. /// /// -/// Based on: https://bartwullems.blogspot.com/2022/03/xunit-change-culture-during-your-test.html +/// Based on: https://bartwullems.blogspot.com/2022/03/xunit-change-culture-during-your-test.html. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class TestCultureAttribute : BeforeAfterTestAttribute @@ -288,7 +286,7 @@ public class TestCultureAttribute : BeforeAfterTestAttribute /// Stores the current and /// and replaces them with the new cultures defined in the constructor. /// - /// The method under test + /// The method under test. public override void Before(MethodInfo methodUnderTest) { originalCulture = Thread.CurrentThread.CurrentCulture; @@ -299,7 +297,7 @@ public override void Before(MethodInfo methodUnderTest) /// /// Restores the original to . /// - /// The method under test + /// The method under test. public override void After(MethodInfo methodUnderTest) { if (originalCulture is not null)