diff --git a/cms/envs/acceptance.py b/cms/envs/acceptance.py index 40d5894378..556687af7e 100644 --- a/cms/envs/acceptance.py +++ b/cms/envs/acceptance.py @@ -16,13 +16,17 @@ DEBUG = True # Disable warnings for acceptance tests, to make the logs readable import logging logging.disable(logging.ERROR) -from uuid import uuid4 +import os + + +def seed(): + return os.getppid() MODULESTORE_OPTIONS = { 'default_class': 'xmodule.raw_module.RawDescriptor', 'host': 'localhost', 'db': 'test_xmodule', - 'collection': 'acceptance_modulestore_%s' % uuid4().hex, + 'collection': 'acceptance_modulestore_%s' % seed(), 'fs_root': TEST_ROOT / "data", 'render_template': 'mitxmako.shortcuts.render_to_string', } @@ -46,7 +50,7 @@ CONTENTSTORE = { 'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore', 'OPTIONS': { 'host': 'localhost', - 'db': 'acceptance_xcontent_%s' % uuid4().hex, + 'db': 'acceptance_xcontent_%s' % seed(), }, # allow for additional options that can be keyed on a name, e.g. 'trashcan' 'ADDITIONAL_OPTIONS': { @@ -62,8 +66,8 @@ CONTENTSTORE = { DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': TEST_ROOT / "db" / "test_mitx.db", - 'TEST_NAME': TEST_ROOT / "db" / "test_mitx.db", + 'NAME': TEST_ROOT / "db" / "test_mitx_%s.db" % seed(), + 'TEST_NAME': TEST_ROOT / "db" / "test_mitx_%s.db" % seed(), } } diff --git a/lms/envs/acceptance.py b/lms/envs/acceptance.py index be604eea8d..ddc1679c37 100644 --- a/lms/envs/acceptance.py +++ b/lms/envs/acceptance.py @@ -16,14 +16,18 @@ DEBUG = True # Disable warnings for acceptance tests, to make the logs readable import logging logging.disable(logging.ERROR) -from uuid import uuid4 +import os + + +def seed(): + return os.getppid() # Use the mongo store for acceptance tests modulestore_options = { 'default_class': 'xmodule.raw_module.RawDescriptor', 'host': 'localhost', 'db': 'test_xmodule', - 'collection': 'acceptance_modulestore_%s' % uuid4().hex, + 'collection': 'acceptance_modulestore_%s' % seed(), 'fs_root': TEST_ROOT / "data", 'render_template': 'mitxmako.shortcuts.render_to_string', } @@ -43,7 +47,7 @@ CONTENTSTORE = { 'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore', 'OPTIONS': { 'host': 'localhost', - 'db': 'acceptance_xcontent_%s' % uuid4().hex, + 'db': 'acceptance_xcontent_%s' % seed(), } } @@ -53,8 +57,8 @@ CONTENTSTORE = { DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': TEST_ROOT / "db" / "test_mitx.db", - 'TEST_NAME': TEST_ROOT / "db" / "test_mitx.db", + 'NAME': TEST_ROOT / "db" / "test_mitx_%s.db" % seed(), + 'TEST_NAME': TEST_ROOT / "db" / "test_mitx_%s.db" % seed(), } }