[ARVADOS] updated: 75c049d9561b08c09f207edb4ebd3bc6fb6460a6
Git user
git at public.curoverse.com
Tue Apr 26 12:01:48 EDT 2016
Summary of changes:
sdk/python/arvados/events.py | 16 ++++++++--------
sdk/python/tests/test_retry.py | 2 +-
sdk/python/tests/test_websockets.py | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
via 75c049d9561b08c09f207edb4ebd3bc6fb6460a6 (commit)
from c1276bd9f83a7826f10e1752ac793d8a1cd3c47f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 75c049d9561b08c09f207edb4ebd3bc6fb6460a6
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue Apr 26 12:01:45 2016 -0400
8931: Fix indentation mistakes. Fix tests.
diff --git a/sdk/python/arvados/events.py b/sdk/python/arvados/events.py
index 4985aaf..d88897f 100644
--- a/sdk/python/arvados/events.py
+++ b/sdk/python/arvados/events.py
@@ -116,14 +116,14 @@ class EventClient(object):
def on_closed(self):
if self.is_closed == False:
_logger.warn("Unexpected close. Reconnecting.")
- for tries_left in RetryLoop(num_retries=25, backoff_start=.1, max_wait=15):
- try:
- self.ec = _EventClient(self.url, self.filters, self.on_event, self.last_log_id, self.on_closed)
- self.ec.connect()
- break
- except Exception as e:
- _logger.warn("Error '%s' during websocket reconnect.", e)
- if tries_left == 0:
+ for tries_left in RetryLoop(num_retries=25, backoff_start=.1, max_wait=15):
+ try:
+ self.ec = _EventClient(self.url, self.filters, self.on_event, self.last_log_id, self.on_closed)
+ self.ec.connect()
+ break
+ except Exception as e:
+ _logger.warn("Error '%s' during websocket reconnect.", e)
+ if tries_left == 0:
_logger.exception("EventClient thread could not contact websocket server.")
self.is_closed = True
thread.interrupt_main()
diff --git a/sdk/python/tests/test_retry.py b/sdk/python/tests/test_retry.py
index c41c42e..cc12f39 100644
--- a/sdk/python/tests/test_retry.py
+++ b/sdk/python/tests/test_retry.py
@@ -141,7 +141,7 @@ class RetryLoopBackoffTestCase(unittest.TestCase, RetryLoopTestMixin):
def test_backoff_multiplier(self, sleep_mock, time_mock):
self.run_loop(5, 500, 501, 502, 503, 504, 505,
- backoff_start=5, backoff_growth=10)
+ backoff_start=5, backoff_growth=10, max_wait=1000000000)
self.check_backoff(sleep_mock, 5, 9)
diff --git a/sdk/python/tests/test_websockets.py b/sdk/python/tests/test_websockets.py
index 475628a..d122a1c 100644
--- a/sdk/python/tests/test_websockets.py
+++ b/sdk/python/tests/test_websockets.py
@@ -242,6 +242,6 @@ class WebsocketTest(run_test_server.TestCaseWithServers):
# verify log messages to ensure retry happened
log_messages = logstream.getvalue()
- found = log_messages.find("Error 'EventClient.connect error' during websocket reconnect. Will retry")
+ found = log_messages.find("Error 'EventClient.connect error' during websocket reconnect.")
self.assertNotEqual(found, -1)
rootLogger.removeHandler(streamHandler)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list