Commit 361ba7a6 authored by Rafael Monnerat's avatar Rafael Monnerat

Verbose to stdout the entries on error_log if the test stalled

This change may help us to understand why the build is stalled when
an error page is showed to the user.
parent 718a48ae
...@@ -252,7 +252,7 @@ class FunctionalTestRunner: ...@@ -252,7 +252,7 @@ class FunctionalTestRunner:
remote_code_url_list = None remote_code_url_list = None
# There is no test that can take more them 24 hours # There is no test that can take more them 2 hours
timeout = 2.0 * 60 * 60 timeout = 2.0 * 60 * 60
def __init__(self, host, port, portal, run_only='', use_phanthom=False): def __init__(self, host, port, portal, run_only='', use_phanthom=False):
...@@ -294,12 +294,20 @@ class FunctionalTestRunner: ...@@ -294,12 +294,20 @@ class FunctionalTestRunner:
while self.getStatus() is None: while self.getStatus() is None:
time.sleep(10) time.sleep(10)
if (time.time() - start) > float(self.timeout): if (time.time() - start) > float(self.timeout):
self.verboseErrorLog()
raise TimeoutError("Test took more them %s seconds" % self.timeout) raise TimeoutError("Test took more them %s seconds" % self.timeout)
finally: finally:
self.browser.quit() self.browser.quit()
xvfb.quit() xvfb.quit()
def verboseErrorLog(self, size=10):
for entry in self.portal.error_log.getLogEntries()[:size]:
print "="*20
print "ERROR ID : %s" % entry["id"]
print "TRACEBACK :"
print entry["tb_text"]
def processResult(self): def processResult(self):
file_content = self.getStatus().encode("utf-8", "replace") file_content = self.getStatus().encode("utf-8", "replace")
sucess_amount = TEST_PASS_RE.search(file_content).group(1) sucess_amount = TEST_PASS_RE.search(file_content).group(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