From 63803d98844d8627f0ce9b93491b11cfb21f28f9 Mon Sep 17 00:00:00 2001 From: Lior Lieberman Date: Wed, 18 Dec 2024 00:30:38 +0000 Subject: [PATCH] replace multi-mirror test cases --- .../httproute-request-percentage-mirror.go | 20 +++++-------------- .../httproute-request-percentage-mirror.yaml | 9 +-------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/conformance/tests/httproute-request-percentage-mirror.go b/conformance/tests/httproute-request-percentage-mirror.go index 693dab4a7f..f557b61924 100644 --- a/conformance/tests/httproute-request-percentage-mirror.go +++ b/conformance/tests/httproute-request-percentage-mirror.go @@ -38,7 +38,7 @@ import ( const ( concurrentRequests = 10 - tolerancePercentage = 15.0 + tolerancePercentage = 5.0 totalRequests = 500.0 numDistributionChecks = 5 ) @@ -54,7 +54,7 @@ var HTTPRouteRequestPercentageMirror = suite.ConformanceTest{ Features: []features.FeatureName{ features.SupportGateway, features.SupportHTTPRoute, - features.SupportHTTPRouteRequestPercentageMirror, + // features.SupportHTTPRouteRequestPercentageMirror, }, Test: func(t *testing.T, suite *suite.ConformanceTestSuite) { var ( @@ -66,7 +66,6 @@ var HTTPRouteRequestPercentageMirror = suite.ConformanceTest{ kubernetes.HTTPRouteMustHaveResolvedRefsConditionsTrue(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN) - // TODO(liorlieberman) add another test to show fraction takes precedence over percent testCases := []http.ExpectedResponse{ { Request: http.Request{Path: "/percent-mirror"}, @@ -101,12 +100,12 @@ var HTTPRouteRequestPercentageMirror = suite.ConformanceTest{ Name: "infra-backend-v2", Namespace: ns, }, - Percent: ptrTo(int32(50)), // 1000/2000 + Percent: ptrTo(int32(50)), }, }, }, { Request: http.Request{ - Path: "/percent-multi-mirror-and-modify-headers", + Path: "/percent-mirror-and-modify-headers", Headers: map[string]string{ "X-Header-Remove": "remove-val", "X-Header-Add-Append": "append-val-1", @@ -114,7 +113,7 @@ var HTTPRouteRequestPercentageMirror = suite.ConformanceTest{ }, ExpectedRequest: &http.ExpectedRequest{ Request: http.Request{ - Path: "/percent-multi-mirror-and-modify-headers", + Path: "/percent-mirror-and-modify-headers", Headers: map[string]string{ "X-Header-Add": "header-val-1", "X-Header-Add-Append": "append-val-1,header-val-2", @@ -133,20 +132,11 @@ var HTTPRouteRequestPercentageMirror = suite.ConformanceTest{ }, Percent: ptrTo(int32(35)), }, - { - BackendRef: http.BackendRef{ - Name: "infra-backend-v3", - Namespace: ns, - }, - Percent: ptrTo(int32(50)), - }, }, }, } for i := range testCases { - // Declare tc here to avoid loop variable - // reuse issues across parallel tests. expected := testCases[i] t.Run(expected.GetTestCaseName(i), func(t *testing.T) { // Assert request succeeds before doing our distribution check diff --git a/conformance/tests/httproute-request-percentage-mirror.yaml b/conformance/tests/httproute-request-percentage-mirror.yaml index f7184e95b5..2a14087654 100644 --- a/conformance/tests/httproute-request-percentage-mirror.yaml +++ b/conformance/tests/httproute-request-percentage-mirror.yaml @@ -44,7 +44,7 @@ spec: - matches: - path: type: PathPrefix - value: /percent-multi-mirror-and-modify-headers + value: /percent-mirror-and-modify-headers filters: - type: RequestHeaderModifier requestHeaderModifier: @@ -65,13 +65,6 @@ spec: namespace: gateway-conformance-infra port: 8080 percent: 35 - - type: RequestMirror - requestMirror: - backendRef: - name: infra-backend-v3 - namespace: gateway-conformance-infra - port: 8080 - percent: 50 backendRefs: - name: infra-backend-v1 port: 8080