solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy

Home Page:https://docs.solo.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CurlEventuallyShouldOutput will succeed on error

sheidkamp opened this issue · comments

Gloo Edge Product

Open Source

Gloo Edge Version

current

Kubernetes Version

any

Describe the bug

When using CurlEventuallyShouldOutput in our tests, if an error other than "pods "testserver" not found" is encountered, the assertion will pass.

This regression was introduced with https://github.com/solo-io/gloo/pull/9316/files#diff-2273798df983633cf972175d2ae31e87a4dd6597d73d9ef9c68d343d07778b22

Because of the refactoring, the comment:

			// trigger an early exit if the pod has been deleted
			// if we return an error here, the Eventually will continue. By making an
			// assertion with the outer context's Gomega, we can trigger a failure at
			// that outer scope.

no longer applies as errors are not being returned

Expected Behavior

When an error occurs in the curl, it will be retried according to the Eventually logic.

Steps to reproduce the bug

In a kubes e2e test, point CurlEventuallyShouldOutput to a resource that is unavailable and it will succeed.

This was specifically encountered before the gateway was ready:

Executing curl
Error in curl: *   Trying 10.96.2.120...
* TCP_NODELAY set
* connect to 10.96.2.120 port 80 failed: Connection refused
* Failed to connect to gateway-proxy port 80: Connection refused
* Closing connection 0
command terminated with exit code 7
 (exit status 7)

Additional Environment Detail

No response

Additional Context

No response