Fix test repo dir not deleted after running
tests: fix leak
Merge from 2660