Added fix to remove tmp directories before running tests

Issue: running tests on CI
(cherry picked from commit 7610e50)
(cherry picked from commit 8a59132)