Kong/kubernetes-ingress-controller
Integration tests not idempotent because of faulty cleanup
Open
#2,652 opened on Jul 6, 2022
area/debtarea/testsbuggood first issuenice-to-haveonboardingpriority/low
Repository metrics
- Stars
- (2,404 stars)
- PR merge metrics
- (PR metrics pending)
Description
Is there an existing issue for this?
- I have searched the existing issues
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.