[ARVADOS] updated: c56743e301b49163a56482c13e49a01c9a0fd7dc

Git user git at public.curoverse.com
Thu Mar 23 10:43:10 EDT 2017


Summary of changes:
 sdk/python/tests/test_cache.py | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

       via  c56743e301b49163a56482c13e49a01c9a0fd7dc (commit)
      from  7772dca4096e64b1033fb9f42e604699ce07f782 (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 c56743e301b49163a56482c13e49a01c9a0fd7dc
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Mar 23 10:43:01 2017 -0400

    10669: Improve error reporting in test case.

diff --git a/sdk/python/tests/test_cache.py b/sdk/python/tests/test_cache.py
index e13fbef..baa60bf 100644
--- a/sdk/python/tests/test_cache.py
+++ b/sdk/python/tests/test_cache.py
@@ -1,7 +1,10 @@
+from __future__ import print_function
+
 import md5
 import mock
 import shutil
 import random
+import sys
 import tempfile
 import threading
 import unittest
@@ -22,13 +25,19 @@ class CacheTestThread(threading.Thread):
     def run(self):
         c = arvados.cache.SafeHTTPCache(self._dir)
         url = 'http://example.com/foo'
+        self.ok = True
         for x in range(16):
-            data_in = _random(128)
-            data_in = md5.new(data_in).hexdigest() + "\n" + str(data_in)
-            c.set(url, data_in)
-            data_out = c.get(url)
-            digest, content = data_out.split("\n", 1)
-            self.ok = (digest == md5.new(content).hexdigest())
+            try:
+                data_in = _random(128)
+                data_in = md5.new(data_in).hexdigest() + "\n" + str(data_in)
+                c.set(url, data_in)
+                data_out = c.get(url)
+                digest, content = data_out.split("\n", 1)
+                if digest != md5.new(content).hexdigest():
+                    self.ok = False
+            except Exception as err:
+                self.ok = False
+                print("cache failed: {}".format(err), file=sys.stderr)
 
 
 class CacheTest(unittest.TestCase):

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list