From 9eb2766943597418a000149694f5c228363052d1 Mon Sep 17 00:00:00 2001 From: Jay Zoldak Date: Thu, 21 Feb 2013 13:07:14 -0500 Subject: [PATCH] Change test modulestore naming differentiation scheme to uuid --- cms/djangoapps/contentstore/tests/utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/utils.py b/cms/djangoapps/contentstore/tests/utils.py index be028b2836..b6b8cd5023 100644 --- a/cms/djangoapps/contentstore/tests/utils.py +++ b/cms/djangoapps/contentstore/tests/utils.py @@ -1,6 +1,6 @@ import json import copy -from time import time +from uuid import uuid4 from django.test import TestCase from django.conf import settings @@ -20,13 +20,12 @@ class ModuleStoreTestCase(TestCase): def _pre_setup(self): super(ModuleStoreTestCase, self)._pre_setup() - # Use the current seconds since epoch to differentiate + # Use a uuid to differentiate # the mongo collections on jenkins. - sec_since_epoch = '%s' % int(time() * 100) self.orig_MODULESTORE = copy.deepcopy(settings.MODULESTORE) self.test_MODULESTORE = self.orig_MODULESTORE - self.test_MODULESTORE['default']['OPTIONS']['collection'] = 'modulestore_%s' % sec_since_epoch - self.test_MODULESTORE['direct']['OPTIONS']['collection'] = 'modulestore_%s' % sec_since_epoch + self.test_MODULESTORE['default']['OPTIONS']['collection'] = 'modulestore_%s' % uuid4().hex + self.test_MODULESTORE['direct']['OPTIONS']['collection'] = 'modulestore_%s' % uuid4().hex settings.MODULESTORE = self.test_MODULESTORE # Flush and initialize the module store