Commit 6f9c80a4 authored by Roque's avatar Roque Committed by Klaus Wölfel

benchmark: minor refactoring and logs

parent 46541384
...@@ -69,6 +69,7 @@ class BenchmarkProcess(multiprocessing.Process): ...@@ -69,6 +69,7 @@ class BenchmarkProcess(multiprocessing.Process):
"another process, flushing remaining results...") "another process, flushing remaining results...")
def getBrowser(self, log_file): def getBrowser(self, log_file):
self._logger.info("[BenchmarkProcess] Browser username and password: %s - %s" % (self._username, self._password))
return Browser(self._argument_namespace.erp5_base_url, return Browser(self._argument_namespace.erp5_base_url,
self._username, self._username,
self._password, self._password,
...@@ -87,8 +88,8 @@ class BenchmarkProcess(multiprocessing.Process): ...@@ -87,8 +88,8 @@ class BenchmarkProcess(multiprocessing.Process):
except StopIteration: except StopIteration:
raise raise
except Exception, e: except Exception, e:
self._logger.info("Exception while running target suite for user %s: %s" % (self._browser._username, str(e)))
msg = "%s: %s" % (target, traceback.format_exc()) msg = "%s: %s" % (target, traceback.format_exc())
try: try:
msg += "Last response headers:\n%s\nLast response contents:\n%s" % \ msg += "Last response headers:\n%s\nLast response contents:\n%s" % \
(self._browser.headers, self._browser.contents) (self._browser.headers, self._browser.contents)
...@@ -115,7 +116,7 @@ class BenchmarkProcess(multiprocessing.Process): ...@@ -115,7 +116,7 @@ class BenchmarkProcess(multiprocessing.Process):
# Clear the Browser history (which keeps (request, response)) # Clear the Browser history (which keeps (request, response))
# otherwise it will consume a lot of memory after some time. Also it # otherwise it will consume a lot of memory after some time. Also it
# does make sense to keep it as suites are independent of each other # does make sense to keep it as suites are independent of each other
self._browser.mech_browser.clear_history() self._browser._history.clear()
result.exitSuite(with_error) result.exitSuite(with_error)
......
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