unittests separated & fixed issue with removing file until thread alive