Print a statement when retrying Selenium test functions.

Pointed out by @nsoranzo (https://github.com/galaxyproject/galaxy/pull/5708#discussion_r175054796) that there isn't mmuch of an indication this is occurring otherwise.
This commit is contained in:
John Chilton
2018-03-16 07:46:59 -04:00
parent d85a53cf13
commit b5a8260765
+4 -2
View File
@@ -136,6 +136,7 @@ def dump_test_information(self, name_prefix):
@nottest
def selenium_test(f):
test_name = f.__name__
@wraps(f)
def func_wrapper(self, *args, **kwds):
@@ -146,13 +147,14 @@ def selenium_test(f):
try:
return f(self, *args, **kwds)
except unittest.SkipTest:
dump_test_information(self, f.__name__)
dump_test_information(self, test_name)
# Don't retry if we have purposely decided to skip the test.
raise
except Exception:
dump_test_information(self, f.__name__)
dump_test_information(self, test_name)
if retry_attempts < GALAXY_TEST_SELENIUM_RETRIES:
retry_attempts += 1
print("Test function [%s] threw an exception, retrying. Failed attempts - %s." % (test_name, retry_attempts))
else:
raise