diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py
--- a/rhodecode/lib/utils.py
+++ b/rhodecode/lib/utils.py
@@ -514,6 +514,11 @@ def create_test_env(repos_test_path, con
     dbconf = config['sqlalchemy.db1.url']
     log.debug('making test db %s', dbconf)
 
+    # create test dir if it doesn't exist
+    if not os.path.isdir(repos_test_path):
+        log.debug('Creating testdir %s' % repos_test_path)
+        os.makedirs(repos_test_path)
+
     dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=config['here'],
                         tests=True)
     dbmanage.create_tables(override=True)
diff --git a/rhodecode/tests/__init__.py b/rhodecode/tests/__init__.py
--- a/rhodecode/tests/__init__.py
+++ b/rhodecode/tests/__init__.py
@@ -38,8 +38,8 @@ import pylons.test
 environ = {}
 
 #SOME GLOBALS FOR TESTS
-TESTS_TMP_PATH = jn('/', 'tmp')
-
+from tempfile import _RandomNameSequence
+TESTS_TMP_PATH = jn('/', 'tmp', 'rc_test_%s' % _RandomNameSequence().next())
 HG_REPO = 'vcs_test_hg'
 GIT_REPO = 'vcs_test_git'