From b931c3ed9d7bcc2f841b754dfe2fd603d008d8cf Mon Sep 17 00:00:00 2001 From: "nastassia.dailidava" Date: Mon, 15 Jan 2024 16:30:02 +0100 Subject: [PATCH] Implemented locality weighted load balancing (fixed tests) --- .../servicemesh/envoycontrol/EnvoySnapshotFactoryTest.kt | 8 -------- .../resource/clusters/EnvoyClustersFactoryTest.kt | 9 --------- .../resource/endpoints/EnvoyEndpointsFactoryTest.kt | 2 -- 3 files changed, 19 deletions(-) diff --git a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/EnvoySnapshotFactoryTest.kt b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/EnvoySnapshotFactoryTest.kt index e3cf1867a..38881da8d 100644 --- a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/EnvoySnapshotFactoryTest.kt +++ b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/EnvoySnapshotFactoryTest.kt @@ -43,7 +43,6 @@ import pl.allegro.tech.servicemesh.envoycontrol.utils.EGRESS_HOST import pl.allegro.tech.servicemesh.envoycontrol.utils.EGRESS_PORT import pl.allegro.tech.servicemesh.envoycontrol.utils.INGRESS_HOST import pl.allegro.tech.servicemesh.envoycontrol.utils.INGRESS_PORT -import pl.allegro.tech.servicemesh.envoycontrol.utils.TRAFFIC_SPLITTING_FORCE_TRAFFIC_ZONE import pl.allegro.tech.servicemesh.envoycontrol.utils.createCluster import pl.allegro.tech.servicemesh.envoycontrol.utils.createClusterConfigurations import pl.allegro.tech.servicemesh.envoycontrol.utils.createEndpoints @@ -56,13 +55,6 @@ class EnvoySnapshotFactoryTest { const val SERVICE_NAME_2 = "service-name-2" } - private val snapshotPropertiesWithWeights = SnapshotProperties().also { - it.loadBalancing.trafficSplitting.serviceByWeightsProperties = mapOf( - DEFAULT_SERVICE_NAME to DEFAULT_CLUSTER_WEIGHTS - ) - it.loadBalancing.trafficSplitting.zoneName = TRAFFIC_SPLITTING_FORCE_TRAFFIC_ZONE - } - @Test fun shouldGetSnapshotListenersForGroupWhenDynamicListenersEnabled() { // given diff --git a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactoryTest.kt b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactoryTest.kt index da0f11f15..d96ca5751 100644 --- a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactoryTest.kt +++ b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactoryTest.kt @@ -10,9 +10,6 @@ import pl.allegro.tech.servicemesh.envoycontrol.snapshot.GlobalSnapshot import pl.allegro.tech.servicemesh.envoycontrol.snapshot.SnapshotProperties import pl.allegro.tech.servicemesh.envoycontrol.utils.CLUSTER_NAME1 import pl.allegro.tech.servicemesh.envoycontrol.utils.CLUSTER_NAME2 -import pl.allegro.tech.servicemesh.envoycontrol.utils.DEFAULT_CLUSTER_WEIGHTS -import pl.allegro.tech.servicemesh.envoycontrol.utils.DEFAULT_SERVICE_NAME -import pl.allegro.tech.servicemesh.envoycontrol.utils.TRAFFIC_SPLITTING_FORCE_TRAFFIC_ZONE import pl.allegro.tech.servicemesh.envoycontrol.utils.createAllServicesGroup import pl.allegro.tech.servicemesh.envoycontrol.utils.createCluster import pl.allegro.tech.servicemesh.envoycontrol.utils.createClusterConfigurations @@ -24,12 +21,6 @@ internal class EnvoyClustersFactoryTest { companion object { private val factory = EnvoyClustersFactory(SnapshotProperties()) - private val snapshotPropertiesWithWeights = SnapshotProperties().apply { - loadBalancing.trafficSplitting.serviceByWeightsProperties = mapOf( - DEFAULT_SERVICE_NAME to DEFAULT_CLUSTER_WEIGHTS - ) - loadBalancing.trafficSplitting.zoneName = TRAFFIC_SPLITTING_FORCE_TRAFFIC_ZONE - } } @Test diff --git a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/endpoints/EnvoyEndpointsFactoryTest.kt b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/endpoints/EnvoyEndpointsFactoryTest.kt index 7f0e08ca4..066ef5092 100644 --- a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/endpoints/EnvoyEndpointsFactoryTest.kt +++ b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/endpoints/EnvoyEndpointsFactoryTest.kt @@ -57,8 +57,6 @@ internal class EnvoyEndpointsFactoryTest { private val serviceName = "service-one" - private val secondaryClusterName = "service-one-secondary" - private val serviceName2 = "service-two" private val defaultWeights = zoneWeights(50, 50)