solo-io / gloo

The Cloud-Native API Gateway and AI Gateway
https://docs.solo.io/
Apache License 2.0
4.1k stars 446 forks source link

TestK8sGateway/DirectResponse/TestInvalidOverlappingFilters #10058

Closed bewebi closed 1 month ago

bewebi commented 1 month ago

Which tests failed?

TestK8sGateway/DirectResponse/TestInvalidOverlappingFilters

Initial Investigation

Twice: https://github.com/solo-io/gloo/actions/runs/10877848909/job/30179850572 https://github.com/solo-io/gloo/actions/runs/10877848909/job/30179850889

Full logs:

=== RUN   TestK8sGateway/DirectResponse/TestInvalidOverlappingFilters
gateway.gateway.networking.k8s.io/gw created
httproute.gateway.networking.k8s.io/httpbin created
directresponse.gateway.gloo.solo.io/test-1 created
directresponse.gateway.gloo.solo.io/test-2 created
pod.go:51: expected pod to have status Running, but it was Pending
want:
HttpResponse{StatusCode: 500, Body: , Headers: map[], Custom: <nil>}
stdout:

stderr:  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 10.96.146.136:8080...
* Connected to gloo-proxy-gw.default.svc.cluster.local (10.96.146.136) port 8080 (#0)
> GET / HTTP/1.1
> Host: www.example.com
> User-Agent: curl/7.83.1-DEV
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< date: Mon, 16 Sep 2024 06:24:22 GMT
< server: envoy
< content-length: 0
< 

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host gloo-proxy-gw.default.svc.cluster.local left intact

success: &{StdErr:  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 10.96.146.136:8080...
* Connected to gloo-proxy-gw.default.svc.cluster.local (10.96.146.136) port 8080 (#0)
> GET / HTTP/1.1
> Host: www.example.com
> User-Agent: curl/7.83.1-DEV
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< date: Mon, 16 Sep 2024 06:24:22 GMT
< server: envoy
< content-length: 0
< 

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host gloo-proxy-gw.default.svc.cluster.local left intact
 StdOut:}=== NAME  TestK8sGateway
    status.go:131: 
        Expected
            <string>: RouteStatus
        to match fields: {
        .Parents:
            Expected
                <[]v1.RouteParentStatus | len:1, cap:4>: [
                    {
                        ParentRef: {
                            Group: "gateway.networking.k8s.io",
                            Kind: "Gateway",
                            Namespace: "default",
                            Name: "gw",
                            SectionName: nil,
                            Port: nil,
                        },
                        ControllerName: "solo.io/gloo-gateway",
                        Conditions: [
                            {
                                Type: "Accepted",
                                Status: "False",
                                ObservedGeneration: 1,
                                LastTransitionTime: {
                                    Time: 2024-09-16T06:24:20Z,
                                },
                                Reason: "IncompatibleFilters",
                                Message: "multiple DirectResponse extension refs found. expected 1, found 2",
                            },
                            {
                                Type: "ResolvedRefs",
                                Status: "True",
                                ObservedGeneration: 1,
                                LastTransitionTime: {
                                    Time: 2024-09-16T06:24:20Z,
                                },
                                Reason: "ResolvedRefs",
                                Message: "",
                            },
                        ],
                    },
                ]
            to contain element matching
                <*gstruct.FieldsMatcher | 0xc004c72cf0>: {
                    Fields: {
                        "Conditions": <*matchers.ContainElementMatcher | 0xc004c72c90>{
                            Element: <*gstruct.FieldsMatcher | 0xc004c72c00>{
                                Fields: {
                                    "Reason": <*matchers.ContainSubstringMatcher | 0xc004c72b70>{
                                        Substr: "BackendNotFound",
                                        Args: nil,
                                    },
                                },
                                IgnoreExtras: true,
                                IgnoreMissing: false,
                                failures: [
                                    <*errors.NestedError | 0xc003095320>{
                                        Path: ".Reason",
                                        Err: <*errors.errorString | 0xc0070ca070>{
                                            s: "Expected\n    <string>: ResolvedRefs\nto contain substring\n    <string>: BackendNotFound",
                                        },
                                    },
                                ],
                            },
                            Result: nil,
                        },
                    },
                    IgnoreExtras: true,
                    IgnoreMissing: false,
                    failures: [
                        <*errors.NestedError | 0xc003095420>{
                            Path: ".Conditions",
                            Err: <*errors.errorString | 0xc0070caa00>{
                                s: "Expected\n    <[]v1.Condition | len:2, cap:4>: [\n        {\n            Type: \"Accepted\",\n            Status: \"False\",\n            ObservedGeneration: 1,\n            LastTransitionTime: {\n                Time: 2024-09-16T06:24:20Z,\n            },\n            Reason: \"IncompatibleFilters\",\n            Message: \"multiple DirectResponse extension refs found. expected 1, found 2\",\n        },\n        {\n            Type: \"ResolvedRefs\",\n            Status: \"True\",\n            ObservedGeneration: 1,\n            LastTransitionTime: {\n                Time: 2024-09-16T06:24:20Z,\n            },\n            Reason: \"ResolvedRefs\",\n            Message: \"\",\n        },\n    ]\nto contain element matching\n    <*gstruct.FieldsMatcher | 0xc004c72c00>: {\n        Fields: {\n            \"Reason\": <*matchers.ContainSubstringMatcher | 0xc004c72b70>{\n                Substr: \"BackendNotFound\",\n                Args: nil,\n            },\n        },\n        IgnoreExtras: true,\n        IgnoreMissing: false,\n        failures: [\n            <*errors.NestedError | 0xc003095320>{\n                Path: \".Reason\",\n                Err: <*errors.errorString | 0xc0070ca070>{\n                    s: \"Expected\\n    <string>: ResolvedRefs\\nto contain substring\\n    <string>: BackendNotFound\",\n                },\n            },\n        ],\n    }",
                            },
                        },
                    ],
                }
        }

        expected: {
          "Custom": {
            "Fields": {
              "Parents": {
                "Element": {
                  "Fields": {
                    "Conditions": {
                      "Element": {
                        "Fields": {
                          "Reason": {
                            "Substr": "BackendNotFound",
                            "Args": null
                          }
                        },
                        "IgnoreExtras": true,
                        "IgnoreMissing": false
                      },
                      "Result": null
                    }
                  },
                  "IgnoreExtras": true,
                  "IgnoreMissing": false
                },
                "Result": null
              }
            },
            "IgnoreExtras": true,
            "IgnoreMissing": false
          }
        }
=== NAME  TestK8sGateway/DirectResponse/TestInvalidOverlappingFilters
    suite.go:226: 
            Error Trace:    /home/runner/work/gloo/gloo/test/kubernetes/e2e/features/directresponse/suite.go:226
            Error:          Condition never satisfied
            Test:           TestK8sGateway/DirectResponse/TestInvalidOverlappingFilters
gateway.gateway.networking.k8s.io "gw" deleted
httproute.gateway.networking.k8s.io "httpbin" deleted
directresponse.gateway.gloo.solo.io "test-1" deleted
directresponse.gateway.gloo.solo.io "test-2" deleted
namespace "httpbin" deleted
serviceaccount "httpbin" deleted
service "httpbin" deleted
deployment.apps "httpbin" deleted
namespace "curl" deleted
pod "curl" deleted

Additional Information

No response

┆Issue is synchronized with this Asana task by Unito

jenshu commented 1 month ago

failed here https://github.com/solo-io/gloo/actions/runs/10923592337/job/30320611977?pr=10061

jenshu commented 1 month ago
        --- FAIL: TestK8sGatewayResourceLimits/DirectResponse/TestInvalidMultipleRouteActions (27.84s)
        --- FAIL: TestK8sGatewayResourceLimits/DirectResponse/TestInvalidOverlappingFilters (12.50s)

https://github.com/solo-io/gloo/actions/runs/10923592337/job/30322900993?pr=10061

jenshu commented 1 month ago

--- FAIL: TestK8sGatewayResourceLimits/DirectResponse/TestInvalidOverlappingFilters (27.87s)

https://github.com/solo-io/gloo/actions/runs/10923592337/job/30328687253?pr=10061

jenshu commented 1 month ago

i'm taking a look at this since it's currently blocking my PR from merging

jenshu commented 1 month ago

also getting the failure locally on a clean main branch

inFocus7 commented 1 month ago

Seen in the latest OSS weekly.

jenshu commented 1 month ago

actually the test doesn't seem to currently run on PRs, but only on nightlies/weeklies. I'm going to redo my PR to avoid running that failing test. we still need to fix this test for nightlies/weeklies