diff --git a/changelog/v1.19.0-beta6/fix-http-listener-flake.yaml b/changelog/v1.19.0-beta6/fix-http-listener-flake.yaml new file mode 100644 index 00000000000..e1c97d6a84e --- /dev/null +++ b/changelog/v1.19.0-beta6/fix-http-listener-flake.yaml @@ -0,0 +1,4 @@ +changelog: +- type: NON_USER_FACING + issueLink: https://github.com/solo-io/gloo/issues/10594 + description: Potentially fixes the TestConfigureNotAttachedHttpListenerOptions flake. It was noticed that the second test generally took longer to run since the inital connections to the proxy would fail. This could be because the proxy does not come up in time or the DNS cache became out of date, and we would curl the old IP diff --git a/test/kubernetes/e2e/features/http_listener_options/http_lis_opt_suite.go b/test/kubernetes/e2e/features/http_listener_options/http_lis_opt_suite.go index 2e08b17927d..e0404c59a08 100644 --- a/test/kubernetes/e2e/features/http_listener_options/http_lis_opt_suite.go +++ b/test/kubernetes/e2e/features/http_listener_options/http_lis_opt_suite.go @@ -48,11 +48,15 @@ func (s *testingSuite) SetupSuite() { s.testInstallation.Assertions.EventuallyPodsRunning(s.ctx, testdefaults.CurlPod.GetNamespace(), metav1.ListOptions{ LabelSelector: "app=curl", }) + s.testInstallation.Assertions.EventuallyObjectsExist(s.ctx, proxyService, proxyDeployment) + s.testInstallation.Assertions.EventuallyPodsRunning(s.ctx, proxyDeployment.ObjectMeta.GetNamespace(), metav1.ListOptions{ + LabelSelector: "app.kubernetes.io/name=gloo-proxy-gw", + }) // include gateway manifests for the tests, so we recreate it for each test run s.manifests = map[string][]string{ - "TestConfigureHttpListenerOptions": {gatewayManifest, basicLisOptManifest}, - "TestConfigureNotAttachedHttpListenerOptions": {gatewayManifest, notAttachedLisOptManifest}, + "TestConfigureHttpListenerOptions": {basicLisOptManifest}, + "TestConfigureNotAttachedHttpListenerOptions": {notAttachedLisOptManifest}, } } @@ -60,6 +64,11 @@ func (s *testingSuite) TearDownSuite() { // Check that the common setup manifest is deleted output, err := s.testInstallation.Actions.Kubectl().DeleteFileWithOutput(s.ctx, setupManifest) s.testInstallation.Assertions.ExpectObjectDeleted(setupManifest, err, output) + + s.testInstallation.Assertions.EventuallyObjectsNotExist(s.ctx, proxyService, proxyDeployment) + s.testInstallation.Assertions.EventuallyPodsNotExist(s.ctx, proxyDeployment.ObjectMeta.GetNamespace(), metav1.ListOptions{ + LabelSelector: "app.kubernetes.io/name=gloo-proxy-gw", + }) } func (s *testingSuite) BeforeTest(suiteName, testName string) { @@ -72,13 +81,6 @@ func (s *testingSuite) BeforeTest(suiteName, testName string) { err := s.testInstallation.Actions.Kubectl().ApplyFile(s.ctx, manifest) s.Assert().NoError(err, "can apply manifest "+manifest) } - - // we recreate the `Gateway` resource (and thus dynamically provision the proxy pod) for each test run - // so let's assert the proxy svc and pod is ready before moving on - s.testInstallation.Assertions.EventuallyObjectsExist(s.ctx, proxyService, proxyDeployment) - s.testInstallation.Assertions.EventuallyPodsRunning(s.ctx, proxyDeployment.ObjectMeta.GetNamespace(), metav1.ListOptions{ - LabelSelector: "app.kubernetes.io/name=gloo-proxy-gw", - }) } func (s *testingSuite) AfterTest(suiteName, testName string) { @@ -91,10 +93,6 @@ func (s *testingSuite) AfterTest(suiteName, testName string) { output, err := s.testInstallation.Actions.Kubectl().DeleteFileWithOutput(s.ctx, manifest) s.testInstallation.Assertions.ExpectObjectDeleted(manifest, err, output) } - s.testInstallation.Assertions.EventuallyObjectsNotExist(s.ctx, proxyService, proxyDeployment) - s.testInstallation.Assertions.EventuallyPodsNotExist(s.ctx, proxyDeployment.ObjectMeta.GetNamespace(), metav1.ListOptions{ - LabelSelector: "app.kubernetes.io/name=gloo-proxy-gw", - }) } func (s *testingSuite) TestConfigureHttpListenerOptions() { diff --git a/test/kubernetes/e2e/features/http_listener_options/testdata/gateway.yaml b/test/kubernetes/e2e/features/http_listener_options/testdata/gateway.yaml deleted file mode 100644 index 5d1a91d5ced..00000000000 --- a/test/kubernetes/e2e/features/http_listener_options/testdata/gateway.yaml +++ /dev/null @@ -1,19 +0,0 @@ -kind: Gateway -apiVersion: gateway.networking.k8s.io/v1 -metadata: - name: gw -spec: - gatewayClassName: gloo-gateway - listeners: - - protocol: HTTP - port: 8080 - name: http - allowedRoutes: - namespaces: - from: Same - - protocol: HTTP - port: 8081 - name: other - allowedRoutes: - namespaces: - from: Same diff --git a/test/kubernetes/e2e/features/http_listener_options/testdata/setup.yaml b/test/kubernetes/e2e/features/http_listener_options/testdata/setup.yaml index b2bafa3c16c..6754cac2927 100644 --- a/test/kubernetes/e2e/features/http_listener_options/testdata/setup.yaml +++ b/test/kubernetes/e2e/features/http_listener_options/testdata/setup.yaml @@ -1,3 +1,23 @@ +kind: Gateway +apiVersion: gateway.networking.k8s.io/v1 +metadata: + name: gw +spec: + gatewayClassName: gloo-gateway + listeners: + - protocol: HTTP + port: 8080 + name: http + allowedRoutes: + namespaces: + from: Same + - protocol: HTTP + port: 8081 + name: other + allowedRoutes: + namespaces: + from: Same +--- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: