Commit ca4ed42c authored by Sebastien Robin's avatar Sebastien Robin Committed by Tatuya Kamada

make DeadlockDebugger working again in unit test

Since DeadlockDebugger is checking for product configuration,
it was no longer working in unit test
parent dd1d49cf
...@@ -75,6 +75,15 @@ install_product_quiet = 1 ...@@ -75,6 +75,15 @@ install_product_quiet = 1
# Quiet messages when installing business templates # Quiet messages when installing business templates
install_bt5_quiet = 0 install_bt5_quiet = 0
from App.config import getConfiguration
config = getConfiguration()
instancehome = config.instancehome
# Make sure we can call manage_debug_threads on a test instance
if getattr(config, 'product_config', None) is None:
config.product_config = {}
config.product_config['deadlockdebugger'] = {'dump_url':'/manage_debug_threads'}
import OFS.Application import OFS.Application
OFS.Application.import_products() OFS.Application.import_products()
...@@ -193,9 +202,6 @@ ZopeTestCase.installProduct('ParsedXML', quiet=install_product_quiet) ...@@ -193,9 +202,6 @@ ZopeTestCase.installProduct('ParsedXML', quiet=install_product_quiet)
# Install everything else which looks like related to ERP5 # Install everything else which looks like related to ERP5
from OFS.Application import get_products from OFS.Application import get_products
from App.config import getConfiguration
instancehome = getConfiguration().instancehome
for priority, product_name, index, product_dir in get_products(): for priority, product_name, index, product_dir in get_products():
# XXX very heuristic # XXX very heuristic
if os.path.isdir(os.path.join(product_dir, product_name, 'Document')) \ if os.path.isdir(os.path.join(product_dir, product_name, 'Document')) \
...@@ -1017,10 +1023,6 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): ...@@ -1017,10 +1023,6 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
if len(setup_done) == 1: # make sure it is run only once if len(setup_done) == 1: # make sure it is run only once
self._setUpDummyMailHost() self._setUpDummyMailHost()
try:
from Products import DeadlockDebugger
except ImportError:
pass
self.serverhost, self.serverport = self.startZServer(verbose=True) self.serverhost, self.serverport = self.startZServer(verbose=True)
self._registerNode(distributing=1, processing=1) self._registerNode(distributing=1, processing=1)
......
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