Commit a1be9701 by Ned Batchelder

Merge pull request #1194 from edx/ned/quiet-tests

Quiet down exceptions at startup, and during tests
parents 3504ce2c 50aa37be
...@@ -179,7 +179,7 @@ class ImportSystem(XMLParsingSystem, MakoDescriptorSystem): ...@@ -179,7 +179,7 @@ class ImportSystem(XMLParsingSystem, MakoDescriptorSystem):
# Normally, we don't want lots of exception traces in our logs from common # Normally, we don't want lots of exception traces in our logs from common
# content problems. But if you're debugging the xml loading code itself, # content problems. But if you're debugging the xml loading code itself,
# uncomment the next line. # uncomment the next line.
log.exception(msg) # log.exception(msg)
self.error_tracker(msg) self.error_tracker(msg)
err_msg = msg + "\n" + exc_info_to_str(sys.exc_info()) err_msg = msg + "\n" + exc_info_to_str(sys.exc_info())
......
...@@ -366,6 +366,10 @@ MODULESTORE = { ...@@ -366,6 +366,10 @@ MODULESTORE = {
} }
CONTENTSTORE = None CONTENTSTORE = None
# Should we initialize the modulestores at startup, or wait until they are
# needed?
INIT_MODULESTORE_ON_STARTUP = True
############# XBlock Configuration ########## ############# XBlock Configuration ##########
# This should be moved into an XBlock Runtime/Application object # This should be moved into an XBlock Runtime/Application object
......
...@@ -110,6 +110,10 @@ MODULESTORE = { ...@@ -110,6 +110,10 @@ MODULESTORE = {
} }
} }
# Starting modulestores generates log messages. If we wait to init modulestores,
# then those messages will be silenced by the test runner.
INIT_MODULESTORE_ON_STARTUP = False
CONTENTSTORE = { CONTENTSTORE = {
'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore', 'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore',
'OPTIONS': { 'OPTIONS': {
......
...@@ -19,7 +19,8 @@ def run(): ...@@ -19,7 +19,8 @@ def run():
""" """
autostartup() autostartup()
# trigger a forced initialization of our modulestores since this can take a while to complete # Trigger a forced initialization of our modulestores since this can take a while to complete
# and we want this done before HTTP requests are accepted # and we want this done before HTTP requests are accepted.
if settings.INIT_MODULESTORE_ON_STARTUP:
for store_name in settings.MODULESTORE: for store_name in settings.MODULESTORE:
modulestore(store_name) modulestore(store_name)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment