~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.~
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.
~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 functionremoveLeftoverEntitiesByTestName
is made. The difference is that it acceptstestName
so that all items in the cleanup list can be filtered by test name (put intocreatedBy
inAddToCleanupListOpenApi
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.