diff --git a/openerp/tests/common.py b/openerp/tests/common.py index 7cc753e810b..e881959a31b 100644 --- a/openerp/tests/common.py +++ b/openerp/tests/common.py @@ -233,6 +233,7 @@ class HttpCase(TransactionCase): _logger.info("phantom_run execution finished") def _wait_remaining_requests(self): + t0 = int(time.time()) for thread in threading.enumerate(): if thread.name.startswith('openerp.service.http.request.'): while thread.isAlive(): @@ -240,6 +241,11 @@ class HttpCase(TransactionCase): # and would prevent the forced shutdown. thread.join(0.05) time.sleep(0.05) + t1 = int(time.time()) + if t0 != t1: + _logger.info('remaining requests') + openerp.tools.misc.dumpstacks() + t0 = t1 def phantom_jsfile(self, jsfile, timeout=60, **kw): options = { diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py index bb61fe2e7a2..d63e2a987e9 100644 --- a/openerp/tools/misc.py +++ b/openerp/tools/misc.py @@ -1171,7 +1171,7 @@ class ConstantMapping(Mapping): return self._value -def dumpstacks(sig, frame): +def dumpstacks(sig=None, frame=None): """ Signal handler: dump a stack trace for each existing thread.""" code = []