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

Unexpected error for failed integration tests - failed cleaning up the cluster #3992

Open
1 of 2 tasks
programmer04 opened this issue May 11, 2023 · 0 comments
Open
1 of 2 tasks

Comments

@programmer04
Copy link
Member

programmer04 commented May 11, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Problem Statement

For integrations tests on GH sometimes error appears

INFO: cluster 00de2b67-83d1-4a4a-9e67-04d96650f14a is being deleted
time="2023-05-11T12:18:38Z" level=debug msg="parsing kubernetes objects into data-plane configuration"
time="2023-05-11T12:18:38Z" level=debug msg="successfully built data-plane configuration"
time="2023-05-11T12:18:38Z" level=debug msg="sending configuration to 1 clients"
time="2023-05-11T12:18:38Z" level=debug msg="converting configuration to deck config" url="http://172.18.0.102:8001/"
ERROR: failed cleaning up the cluster: Delete "https://127.0.0.1:40807/apis/gateway.networking.k8s.io/v1beta1/gatewayclasses/kong-unmanaged": dial tcp 127.0.0.1:40807: connect: connection refused
FAIL	github.com/kong/kubernetes-ingress-controller/v2/test/integration	1504.984s
FAIL

e.g. full log.

to reproduce this error make some integration test fail, e.g. TestTLSRouteReferenceGrant by putting inside it

t.Fatal("fatal error")

and run it

make test.integration.dbless GOTESTFLAGS="-count 1 -run TestTLSRouteReferenceGrant"

cluster is removed entirely (as expected), but the error message is printed.

Proposed Solution

No response

Additional information

It comes from

gwc, err := DeployGatewayClass(ctx, gatewayClient, unmanagedGatewayClassName)
exitOnErr(ctx, err)
cleaner.Add(gwc)

We clean up the cluster at the end of suite_test.go

if testenv.KeepTestCluster() == "" && testenv.ExistingClusterName() == "" {
ctx, cancel := context.WithTimeout(context.Background(), environmentCleanupTimeout)
defer cancel()
fmt.Printf("INFO: cluster %s is being deleted\n", env.Cluster().Name())
exitOnErr(ctx, env.Cleanup(ctx))
}

but we defer the cleaner's cleanup.

Acceptance Criteria

  • Tests in case of failure should not log the error reported in this issue
@programmer04 programmer04 changed the title Flaky integration tests - failed cleaning up the cluster Unexpected error for failed integration tests - failed cleaning up the cluster Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant