From b5a8260765005ef87f39ed717ff65daf7e73ff18 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 16 Mar 2018 07:45:43 -0400 Subject: [PATCH] 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. --- test/selenium_tests/framework.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/selenium_tests/framework.py b/test/selenium_tests/framework.py index dbc60c460f9..1b93fad5a4c 100644 --- a/test/selenium_tests/framework.py +++ b/test/selenium_tests/framework.py @@ -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