diff --git a/cms/envs/test.py b/cms/envs/test.py index c7022d98db..f9ace115b1 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -85,10 +85,10 @@ update_module_store_settings( 'fs_root': TEST_ROOT / "data", }, doc_store_settings={ - 'db': 'test_xmodule', + 'db': 'test_xmodule_{}'.format(THIS_UUID), 'host': MONGO_HOST, 'port': MONGO_PORT_NUM, - 'collection': 'test_modulestore{0}'.format(THIS_UUID), + 'collection': 'test_modulestore', }, ) diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py index 94a5d7fd78..61100e4d71 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py @@ -8,6 +8,7 @@ from path import Path as path import random import re import unittest +import os import uuid import ddt @@ -53,9 +54,9 @@ class SplitModuleTest(unittest.TestCase): # Snippets of what would be in the django settings envs file DOC_STORE_CONFIG = { 'host': MONGO_HOST, - 'db': 'test_xmodule', + 'db': 'test_xmodule_{0}'.format(os.getpid()), 'port': MONGO_PORT_NUM, - 'collection': 'modulestore{0}'.format(uuid.uuid4().hex[:5]), + 'collection': 'modulestore', } modulestore_options = { 'default_class': 'xmodule.raw_module.RawDescriptor', diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py b/common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py index 97881b6aaf..c8121bc769 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py @@ -2,7 +2,7 @@ import datetime import random import unittest import uuid - +import os import mock import pytest @@ -35,7 +35,8 @@ class SplitWMongoCourseBootstrapper(unittest.TestCase): db_config = { 'host': MONGO_HOST, 'port': MONGO_PORT_NUM, - 'db': 'test_xmodule', + 'db': 'test_xmodule_{}'.format(os.getpid()), + 'collection': 'modulestore' } modulestore_options = { @@ -48,8 +49,6 @@ class SplitWMongoCourseBootstrapper(unittest.TestCase): split_course_key = CourseLocator('test_org', 'test_course', 'runid', branch=ModuleStoreEnum.BranchName.draft) def setUp(self): - self.db_config['collection'] = 'modulestore{0}'.format(uuid.uuid4().hex[:5]) - self.user_id = random.getrandbits(32) super(SplitWMongoCourseBootstrapper, self).setUp() self.split_mongo = SplitMongoModuleStore( diff --git a/common/lib/xmodule/xmodule/modulestore/tests/utils.py b/common/lib/xmodule/xmodule/modulestore/tests/utils.py index 45d297cc7a..2ae0b06cd5 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/utils.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/utils.py @@ -9,6 +9,7 @@ from path import Path as path from shutil import rmtree from tempfile import mkdtemp from unittest import TestCase +import os from xmodule.x_module import XModuleMixin from xmodule.contentstore.mongo import MongoContentStore @@ -87,7 +88,7 @@ class MixedSplitTestCase(TestCase): DOC_STORE_CONFIG = { 'host': MONGO_HOST, 'port': MONGO_PORT_NUM, - 'db': 'test_mongo_libs', + 'db': 'test_mongo_libs_{0}'.format(os.getpid()), 'collection': 'modulestore', 'asset_collection': 'assetstore', }