Commit 3e12b87c authored by Arnaud Fontaine's avatar Arnaud Fontaine

Display properly the traceback upon error


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@46009 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 444e3e95
......@@ -304,7 +304,9 @@ class CSVBenchmarkResult(BenchmarkResult):
if exc_type:
msg = "An error occured, see: %s" % self._log_filename_path
self.getLogger().error("%s: %s\n%s" % (exc_type, exc_value, traceback))
from traceback import format_tb
self.getLogger().error("%s: %s\n%s" % (exc_type, exc_value,
''.join(format_tb(traceback))))
if isinstance(exc_type, StopIteration):
raise StopIteration, msg
else:
......@@ -468,9 +470,9 @@ class BenchmarkProcess(multiprocessing.Process):
exit_msg = None
try:
self._browser = self.getBrowser(result_instance.log_file)
with result_instance as result:
self._browser = self.getBrowser(result_instance.log_file)
while self._current_repeat != (self._argument_namespace.repeat + 1):
self._logger.info("Iteration: %d" % self._current_repeat)
self.runBenchmarkSuiteList(result)
......@@ -487,8 +489,5 @@ class BenchmarkProcess(multiprocessing.Process):
exit_msg = e
exit_status = 2
if exit_msg:
self._logger.error(exit_msg)
self._exit_msg_queue.put(exit_msg)
sys.exit(exit_status)
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