[ARVADOS] updated: ea78f6979b62a625ded2a2122f5add6c904139eb

git at public.curoverse.com git at public.curoverse.com
Tue Nov 17 12:50:37 EST 2015


Summary of changes:
 sdk/python/arvados/keep.py           |  4 ++--
 sdk/python/tests/test_keep_client.py | 20 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)

       via  ea78f6979b62a625ded2a2122f5add6c904139eb (commit)
      from  0610dd902a4049d64f4c69eb9426a35e30646215 (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 ea78f6979b62a625ded2a2122f5add6c904139eb
Author: sguthrie <sallyeguthrie at gmail.com>
Date:   Tue Nov 17 12:50:31 2015 -0500

    Round up LOW_SPEED_TIME and LOW_SPEED_LIMIT to the nearest integer. Modify tests correctly. All tests pass

diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index 28e0b60..e01fec4 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -489,8 +489,8 @@ class KeepClient(object):
                 conn_t, xfer_t = (timeouts, timeouts)
                 bandwidth_bps = KeepClient.DEFAULT_TIMEOUT[2]
             curl.setopt(pycurl.CONNECTTIMEOUT_MS, int(conn_t*1000))
-            curl.setopt(pycurl.LOW_SPEED_TIME, int(xfer_t))
-            curl.setopt(pycurl.LOW_SPEED_LIMIT, int(bandwidth_bps))
+            curl.setopt(pycurl.LOW_SPEED_TIME, int(math.ceil(xfer_t)))
+            curl.setopt(pycurl.LOW_SPEED_LIMIT, int(math.ceil(bandwidth_bps)))
 
         def _headerfunction(self, header_line):
             header_line = header_line.decode('iso-8859-1')
diff --git a/sdk/python/tests/test_keep_client.py b/sdk/python/tests/test_keep_client.py
index 6db1bea..ee897db 100644
--- a/sdk/python/tests/test_keep_client.py
+++ b/sdk/python/tests/test_keep_client.py
@@ -689,15 +689,15 @@ class KeepClientTimeout(unittest.TestCase, tutil.ApiClientMock):
                 kc.put(self.DATA, copies=1, num_retries=0)
 
     def test_timeout_slow_request(self):
-        self.server.setdelays(request=0.2)
+        self.server.setdelays(request=2)
         self._test_200ms()
 
     def test_timeout_slow_response(self):
-        self.server.setdelays(response=0.2)
+        self.server.setdelays(response=2)
         self._test_200ms()
 
     def test_timeout_slow_response_body(self):
-        self.server.setdelays(response_body=0.2)
+        self.server.setdelays(response_body=2)
         self._test_200ms()
 
     def _test_200ms(self):
@@ -706,19 +706,19 @@ class KeepClientTimeout(unittest.TestCase, tutil.ApiClientMock):
         # 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, 1))
-        with self.assertTakesBetween(.2, .3):
+        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):
+        with self.assertTakesBetween(2, 3):
             self.assertEqual(self.DATA, kc.get(loc, num_retries=0))
 
-        # Allow 1s to connect, then 100ms for response. Nothing should
+        # Allow 1s to connect, then 2s for response. Nothing should
         # work, and everything should take at least 100ms to return.
-        kc = self.keepClient(timeouts=(1, .1))
-        with self.assertTakesBetween(.1, .2):
+        kc = self.keepClient(timeouts=(10, 1))
+        with self.assertTakesBetween(1, 2):
             with self.assertRaises(arvados.errors.KeepReadError):
                 kc.get(loc, num_retries=0)
-        with self.assertTakesBetween(.1, .2):
+        with self.assertTakesBetween(1, 2):
             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