Fix Pipeline CI OOM issue
# What does this PR do?


_The documentation is not available anymore as the PR was closed or merged._<|||||>>     1. Do you think this memory handling is something we should extend to most model tests by default?  Is there too much of an overhead repeatedly clearing the cache / GC or other reasons it's not suitable?

This cleanup is only necessary for integration tests, but yes, I think it's best to apply this to all model (integration) tests.

>     2. Could we create a general utility in testing utils to avoid some of the repeated code e.g.

Yes! I am also thinking if we should define a subclass of unittest.TestCase and have a common `def tearDown`.
Let's talk this and/or your suggestion above later.
