[ARVADOS] updated: 172acda5515318753c70fa8f0d498c78c129ef85

git at public.curoverse.com git at public.curoverse.com
Tue Nov 17 13:47:38 EST 2015


Summary of changes:
 sdk/python/tests/test_keep_client.py | 43 +++++++++++++++++++++++-------------
 1 file changed, 28 insertions(+), 15 deletions(-)

       via  172acda5515318753c70fa8f0d498c78c129ef85 (commit)
       via  d4a64216003caae526f54625aa2769c9eb553cef (commit)
      from  ea78f6979b62a625ded2a2122f5add6c904139eb (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 172acda5515318753c70fa8f0d498c78c129ef85
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Nov 17 13:47:38 2015 -0500

    7235: Fixup whitespace & comment fmt

diff --git a/sdk/python/tests/test_keep_client.py b/sdk/python/tests/test_keep_client.py
index fee1031..52eb0e9 100644
--- a/sdk/python/tests/test_keep_client.py
+++ b/sdk/python/tests/test_keep_client.py
@@ -580,11 +580,15 @@ class KeepClientRendezvousTestCase(unittest.TestCase, tutil.ApiClientMock):
     def test_put_error_shows_probe_order(self):
         self.check_64_zeros_error_order('put', arvados.errors.KeepWriteError)
 
+
 class KeepClientTimeout(unittest.TestCase, tutil.ApiClientMock):
-    #Needs to be low to trigger bandwidth errors before we run out of data
+    # BANDWIDTH_LOW_LIM must be less than len(DATA) so we can transfer
+    # 1s worth of data and then trigger bandwidth errors before running
+    # out of data.
     DATA = 'x'*2**11
     BANDWIDTH_LOW_LIM = 1024
     TIMEOUT_TIME = 1.0
+
     class assertTakesBetween(unittest.TestCase):
         def __init__(self, tmin, tmax):
             self.tmin = tmin
@@ -730,6 +734,7 @@ class KeepClientTimeout(unittest.TestCase, tutil.ApiClientMock):
             with self.assertRaises(arvados.errors.KeepWriteError):
                 kc.put(self.DATA, copies=1, num_retries=0)
 
+
 class KeepClientGatewayTestCase(unittest.TestCase, tutil.ApiClientMock):
     def mock_disks_and_gateways(self, disks=3, gateways=1):
         self.gateways = [{

commit d4a64216003caae526f54625aa2769c9eb553cef
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Nov 17 13:40:00 2015 -0500

    7235: Make 2-tuple-timeout tests a bit quicker.

diff --git a/sdk/python/tests/test_keep_client.py b/sdk/python/tests/test_keep_client.py
index ee897db..fee1031 100644
--- a/sdk/python/tests/test_keep_client.py
+++ b/sdk/python/tests/test_keep_client.py
@@ -689,36 +689,44 @@ class KeepClientTimeout(unittest.TestCase, tutil.ApiClientMock):
                 kc.put(self.DATA, copies=1, num_retries=0)
 
     def test_timeout_slow_request(self):
+        loc = self.keepClient().put(self.DATA, copies=1, num_retries=0)
+        self.server.setdelays(request=.2)
+        self._test_connect_timeout_under_200ms(loc)
         self.server.setdelays(request=2)
-        self._test_200ms()
+        self._test_response_timeout_under_2s(loc)
 
     def test_timeout_slow_response(self):
+        loc = self.keepClient().put(self.DATA, copies=1, num_retries=0)
+        self.server.setdelays(response=.2)
+        self._test_connect_timeout_under_200ms(loc)
         self.server.setdelays(response=2)
-        self._test_200ms()
+        self._test_response_timeout_under_2s(loc)
 
     def test_timeout_slow_response_body(self):
+        loc = self.keepClient().put(self.DATA, copies=1, num_retries=0)
+        self.server.setdelays(response_body=.2)
+        self._test_connect_timeout_under_200ms(loc)
         self.server.setdelays(response_body=2)
-        self._test_200ms()
-
-    def _test_200ms(self):
-        """Connect should be t<100ms, request should be 200ms <= t < 300ms"""
+        self._test_response_timeout_under_2s(loc)
 
+    def _test_connect_timeout_under_200ms(self, loc):
         # Allow 100ms to connect, then 1s for response. Everything
         # should work, and everything should take at least 200ms to
         # return.
-        kc = self.keepClient(timeouts=(1, 10))
-        with self.assertTakesBetween(2, 3):
-            loc = kc.put(self.DATA, copies=1, num_retries=0)
-        with self.assertTakesBetween(2, 3):
+        kc = self.keepClient(timeouts=(.1, 1))
+        with self.assertTakesBetween(.2, .3):
+            kc.put(self.DATA, copies=1, num_retries=0)
+        with self.assertTakesBetween(.2, .3):
             self.assertEqual(self.DATA, kc.get(loc, num_retries=0))
 
-        # Allow 1s to connect, then 2s for response. Nothing should
-        # work, and everything should take at least 100ms to return.
+    def _test_response_timeout_under_2s(self, loc):
+        # Allow 10s to connect, then 1s for response. Nothing should
+        # work, and everything should take at least 1s to return.
         kc = self.keepClient(timeouts=(10, 1))
-        with self.assertTakesBetween(1, 2):
+        with self.assertTakesBetween(1, 1.9):
             with self.assertRaises(arvados.errors.KeepReadError):
                 kc.get(loc, num_retries=0)
-        with self.assertTakesBetween(1, 2):
+        with self.assertTakesBetween(1, 1.9):
             with self.assertRaises(arvados.errors.KeepWriteError):
                 kc.put(self.DATA, copies=1, num_retries=0)
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list