pan3793 commented on code in PR #7595:
URL: https://github.com/apache/kyuubi/pull/7595#discussion_r3672976883


##########
python/pyhive/tests/test_hive.py:
##########
@@ -30,13 +30,37 @@
 from pyhive.tests.dbapi_test_case import with_cursor
 
 _HOST = 'localhost'
+_CONNECT_ATTEMPTS = 5
+_CONNECT_RETRY_DELAY_SECONDS = 2
 
 
 class TestHive(unittest.TestCase, DBAPITestCase):
     __test__ = True
 
     def connect(self):
-        return hive.connect(host=_HOST, port=10000, 
configuration={'mapred.job.tracker': 'local'})
+        for attempt in range(_CONNECT_ATTEMPTS):
+            try:
+                return hive.connect(
+                    host=_HOST, port=10000, 
configuration={'mapred.job.tracker': 'local'})
+            except TTransportException:

Review Comment:
   could you narrow the catch (e.g. to `TTransportException` with 
`END_OF_FILE`/`TIMED_OUT` types, or checking the message) to avoid slowing real 
failures? e.g., a wrong LDAP password raises `TTransportException: Error 
validating the login`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to