Skip to content

Commit

Permalink
updating
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Volchok <[email protected]>
  • Loading branch information
alexwo committed Dec 11, 2024
1 parent 758d12f commit 9422c81
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions test/resilience/tests/envoygateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var EGResilience = suite.ResilienceTest{
ap.MustApplyWithCleanup(t, suite.Client, suite.TimeoutConfig, "testdata/base.yaml", true)

//this test will fail until https://github.com/envoyproxy/gateway/pull/4767/files is merged
t.Run("Secondary EnvoyGateway instances can serve an up to date xds", func(t *testing.T) {
t.Run("Secondary EnvoyGateway instances can serve an up to date xDS", func(t *testing.T) {
ctx := context.Background()
t.Log("Scaling down the deployment to 0 replicas")
err := suite.Kube().ScaleDeploymentAndWait(ctx, envoygateway, namespace, 0, time.Minute, false)
Expand Down Expand Up @@ -108,7 +108,7 @@ var EGResilience = suite.ResilienceTest{
})
})

t.Run("EnvoyGateway reconciles missed resources and sync xds after api server connectivity is restored", func(t *testing.T) {
t.Run("EnvoyGateway reconciles missed resources and sync xDS after api server connectivity is restored", func(t *testing.T) {
err := suite.Kube().ScaleDeploymentAndWait(context.Background(), envoygateway, namespace, 0, timeout, false)
require.NoError(t, err, "Failed to scale deployment")
err = suite.Kube().ScaleDeploymentAndWait(context.Background(), envoygateway, namespace, 1, timeout, false)
Expand All @@ -124,24 +124,18 @@ var EGResilience = suite.ResilienceTest{
})
require.NoError(t, err, "unable to block api server connectivity")

err = suite.Kube().WaitForDeploymentReplicaCount(context.Background(), "envoy-gatay", namespace, 0, time.Minute, false)

ap.MustApplyWithCleanup(t, suite.Client, suite.TimeoutConfig, "testdata/route_changes.yaml", true)
t.Log("backend routes changed")

t.Log("restore API server connectivity")
_, err = suite.Kube().ManageEgress(context.Background(), apiServerIP, namespace, policyName, false, map[string]string{})
require.NoError(t, err, "unable to unblock api server connectivity")

err = suite.Kube().WaitForDeploymentReplicaCount(context.Background(), "envoy-gateway", namespace, 1, time.Minute, false)
err = suite.Kube().WaitForDeploymentReplicaCount(context.Background(), envoygateway, namespace, 1, time.Minute, false)
require.NoError(t, err, "Failed to ensure that pod is online")
t.Log("eg is online")

t.Log("Monitoring logs to identify the leader pod")

_, err = suite.Kube().GetElectedLeader(context.Background(), namespace, leaseName, metav1.Now(), time.Minute*2)
require.NoError(t, err, "unable to detect leader election")

t.Log("eg is online")
ns := "gateway-resilience"
routeNN := types.NamespacedName{Name: "backend", Namespace: ns}
gwNN := types.NamespacedName{Name: "all-namespaces", Namespace: ns}
Expand Down Expand Up @@ -202,7 +196,7 @@ var EGResilience = suite.ResilienceTest{
require.NoError(t, err, "Failed to simulate API server connection failure")

// leader pod should go down, the standby remain
t.Log("Verifying deployment scales down to 1 replica")
t.Log("Verifying deployment scales down to 1 replicas")
err = suite.Kube().CheckDeploymentReplicas(ctx, envoygateway, namespace, 1, time.Minute)
require.NoError(t, err, "Deployment did not scale down")

Expand Down

0 comments on commit 9422c81

Please sign in to comment.