Kong / kubernetes-ingress-controller

:gorilla: Kong for Kubernetes: The official Ingress Controller for Kubernetes.
https://docs.konghq.com/kubernetes-ingress-controller/
Apache License 2.0
2.2k stars 590 forks source link

Integration tests not idempotent because of faulty cleanup #2652

Open mlavacca opened 2 years ago

mlavacca commented 2 years ago

Is there an existing issue for this?

Current Behavior

When integration tests are executed, a lot of cleaning functions are deferred to the end of the test. The problem is that we use the exitOnErr function to assert that no error must occur. Whenever such a function fails, the program exits, and all the deferred functions are not executed anymore. This leads to having orphaned resources.

Expected Behavior

We should use the new mechanism introduced in KTF to clean resources, instead of the deferred functions. See https://github.com/Kong/kubernetes-ingress-controller/issues/2618 as a similar issue in KTF.

mflendrich commented 2 years ago

Currently we don't see strong drivers behind this issue. Does not conern CI runs; @jrsmroz worked around this by purging the kind cluster between re-runs. Labeling as nice-to-have therefore.