vmware / go-vcloud-director

Golang SDK for VMware Cloud Director
Other
80 stars 79 forks source link

Use verbose retry function for ALB test cleanup #614

Closed Didainius closed 11 months ago

Didainius commented 11 months ago

~This PR attempts to improve on test cleanup for some cases by providing an experimental solution.~

~These cases for now are related to ALB, which sometimes (although very rarely) can fail in an unexpected place. These failures happen in unexpected places and it is not always possible to catch all of them.~

~I have looked at 2 ways of improving cleanup so that other tests are not impacted:~ ~ build explicit cleanup code~ ~ Reuse already existing cleanup list. This looks to be more universal and has less overhead.~

~The general idea is to build a similar function to removeLeftoverEntities which is being triggered at the end of test (unless prevented). A new function removeLeftoverEntitiesByTestName is made. The difference is that it accepts testName so that all items in the cleanup list can be filtered by test name (put into createdBy in AddToCleanupListOpenApi function). That way we can be sure that cleanup is performed only on the entities, that were created by that particular test.~

The above approach was tried in 2ba1109.

Latest approach is to hit the problem at exact place were it occurred by trying to perform a verbose retry for operation using new function retryOnError which is used for testing.