Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of improve reliability of acceptance tests into release/1.4.x #3807

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions acceptance/framework/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ func RunCommand(t testutil.TestingTB, options *k8s.KubectlOptions, command Comma

select {
case res := <-resultCh:
if res.err != nil {
logger.Logf(t, "Output: %v.", res.output)
}
return res.output, res.err
// Sometimes this func runs for too long handle timeout if needed.
case <-time.After(320 * time.Second):
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/api-gateway/api_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,14 @@ func TestAPIGateway_Basic(t *testing.T) {
logger.Log(t, "creating static-client pod")
k8s.DeployKustomize(t, ctx.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.NoCleanup, cfg.DebugDirectory, "../fixtures/bases/static-client")

k8s.RunKubectl(t, ctx.KubectlOptions(t), "wait", "--for=condition=available", "--timeout=5m", fmt.Sprintf("deploy/%s", "static-server"))

logger.Log(t, "patching route to target http server")
k8s.RunKubectl(t, ctx.KubectlOptions(t), "patch", "httproute", "http-route", "-p", `{"spec":{"rules":[{"backendRefs":[{"name":"static-server","port":80}]}]}}`, "--type=merge")

logger.Log(t, "creating target tcp server")
k8s.DeployKustomize(t, ctx.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.NoCleanup, cfg.DebugDirectory, "../fixtures/bases/static-server-tcp")
k8s.RunKubectl(t, ctx.KubectlOptions(t), "wait", "--for=condition=available", "--timeout=5m", fmt.Sprintf("deploy/%s", "static-server-tcp"))

logger.Log(t, "creating tcp-route")
k8s.RunKubectl(t, ctx.KubectlOptions(t), "apply", "-f", "../fixtures/cases/api-gateways/tcproute/route.yaml")
Expand Down
Loading