[ARVADOS] created: 9209660a3bd951c3945bce0da2fa9195cb002e44
git at public.curoverse.com
git at public.curoverse.com
Fri Aug 7 01:49:33 EDT 2015
at 9209660a3bd951c3945bce0da2fa9195cb002e44 (commit)
commit 9209660a3bd951c3945bce0da2fa9195cb002e44
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Aug 7 01:26:57 2015 -0400
6844: Clear inserted data/logs after websocket tests.
diff --git a/sdk/python/tests/test_websockets.py b/sdk/python/tests/test_websockets.py
index ffa310b..d7285aa 100644
--- a/sdk/python/tests/test_websockets.py
+++ b/sdk/python/tests/test_websockets.py
@@ -1,12 +1,12 @@
-import Queue
-import run_test_server
-import unittest
import arvados
import arvados.events
+from datetime import datetime, timedelta
import mock
+import Queue
+import run_test_server
import threading
-from datetime import datetime, timedelta
import time
+import unittest
class WebsocketTest(run_test_server.TestCaseWithServers):
MAIN_SERVER = {}
@@ -18,6 +18,7 @@ class WebsocketTest(run_test_server.TestCaseWithServers):
if self.ws:
self.ws.close()
super(WebsocketTest, self).tearDown()
+ run_test_server.reset()
def _test_subscribe(self, poll_fallback, expect_type, last_log_id=None, additional_filters=None, expected=1):
run_test_server.authorize_with('active')
diff --git a/services/api/test/fixtures/humans.yml b/services/api/test/fixtures/humans.yml
new file mode 100644
index 0000000..9c17fd2
--- /dev/null
+++ b/services/api/test/fixtures/humans.yml
@@ -0,0 +1 @@
+# File exists to ensure the table gets cleared during DatabaseController#reset
commit 0988acb472849dc08d576ee40493e70bde2132ca
Author: Tom Clegg <tom at clinicalfuture.com>
Date: Fri Aug 7 03:35:42 2015 +0000
6844: Do not use inspect.getcallargs: it leaks memory. Passing num_retries as a positional argument is no longer supported.
diff --git a/sdk/python/arvados/arvfile.py b/sdk/python/arvados/arvfile.py
index 7cd64aa..ce0e5e3 100644
--- a/sdk/python/arvados/arvfile.py
+++ b/sdk/python/arvados/arvfile.py
@@ -129,7 +129,7 @@ class ArvadosFileReaderBase(_FileLikeObjectBase):
@_FileLikeObjectBase._before_close
@retry_method
def decompress(self, decompress, size, num_retries=None):
- for segment in self.readall(size, num_retries):
+ for segment in self.readall(size, num_retries=num_retries):
data = decompress(segment)
if data:
yield data
@@ -1070,7 +1070,7 @@ class ArvadosFileWriter(ArvadosFileReader):
@retry_method
def writelines(self, seq, num_retries=None):
for s in seq:
- self.write(s, num_retries)
+ self.write(s, num_retries=num_retries)
@_FileLikeObjectBase._before_close
def truncate(self, size=None):
diff --git a/sdk/python/arvados/retry.py b/sdk/python/arvados/retry.py
index e4ad644..d8f5317 100644
--- a/sdk/python/arvados/retry.py
+++ b/sdk/python/arvados/retry.py
@@ -148,8 +148,7 @@ def retry_method(orig_func):
"""
@functools.wraps(orig_func)
def num_retries_setter(self, *args, **kwargs):
- arg_vals = inspect.getcallargs(orig_func, self, *args, **kwargs)
- if arg_vals['num_retries'] is None:
+ if kwargs.get('num_retries') is None:
kwargs['num_retries'] = self.num_retries
return orig_func(self, *args, **kwargs)
return num_retries_setter
diff --git a/sdk/python/tests/test_retry.py b/sdk/python/tests/test_retry.py
index 4f147ba..c41c42e 100644
--- a/sdk/python/tests/test_retry.py
+++ b/sdk/python/tests/test_retry.py
@@ -201,8 +201,10 @@ class RetryMethodTestCase(unittest.TestCase):
return (a, num_retries, z)
- def test_positional_arg_passed(self):
- self.assertEqual((3, 2, 0), self.Tester().check(3, 2))
+ def test_positional_arg_raises(self):
+ # unsupported use -- make sure we raise rather than ignore
+ with self.assertRaises(TypeError):
+ self.assertEqual((3, 2, 0), self.Tester().check(3, 2))
def test_keyword_arg_passed(self):
self.assertEqual((4, 3, 0), self.Tester().check(num_retries=3, a=4))
commit f46b05c041684ced4cf438ae6cade577156f81a5
Author: Tom Clegg <tom at clinicalfuture.com>
Date: Fri Aug 7 03:33:26 2015 +0000
6844: Always write a valid \n-terminated manifest. Confine exception-catching to expected exceptions.
diff --git a/sdk/python/arvados/commands/arv_copy.py b/sdk/python/arvados/commands/arv_copy.py
index 2543ad4..f728b2c 100755
--- a/sdk/python/arvados/commands/arv_copy.py
+++ b/sdk/python/arvados/commands/arv_copy.py
@@ -547,31 +547,30 @@ def copy_collection(obj_uuid, src, dst, args):
else:
progress_writer = None
- for line in manifest.splitlines(True):
+ for line in manifest.splitlines():
words = line.split()
- dst_manifest_line = words[0]
+ dst_manifest += words[0]
for word in words[1:]:
try:
loc = arvados.KeepLocator(word)
- blockhash = loc.md5sum
- # copy this block if we haven't seen it before
- # (otherwise, just reuse the existing dst_locator)
- if blockhash not in dst_locators:
- logger.debug("Copying block %s (%s bytes)", blockhash, loc.size)
- if progress_writer:
- progress_writer.report(obj_uuid, bytes_written, bytes_expected)
- data = src_keep.get(word)
- dst_locator = dst_keep.put(data)
- dst_locators[blockhash] = dst_locator
- bytes_written += loc.size
- dst_manifest_line += ' ' + dst_locators[blockhash]
except ValueError:
# If 'word' can't be parsed as a locator,
# presume it's a filename.
- dst_manifest_line += ' ' + word
- dst_manifest += dst_manifest_line
- if line.endswith("\n"):
- dst_manifest += "\n"
+ dst_manifest += ' ' + word
+ continue
+ blockhash = loc.md5sum
+ # copy this block if we haven't seen it before
+ # (otherwise, just reuse the existing dst_locator)
+ if blockhash not in dst_locators:
+ logger.debug("Copying block %s (%s bytes)", blockhash, loc.size)
+ if progress_writer:
+ progress_writer.report(obj_uuid, bytes_written, bytes_expected)
+ data = src_keep.get(word)
+ dst_locator = dst_keep.put(data)
+ dst_locators[blockhash] = dst_locator
+ bytes_written += loc.size
+ dst_manifest += ' ' + dst_locators[blockhash]
+ dst_manifest += "\n"
if progress_writer:
progress_writer.report(obj_uuid, bytes_written, bytes_expected)
commit fc851b249ea25a40a1fb392906705142113ac5b9
Author: Tom Clegg <tom at clinicalfuture.com>
Date: Fri Aug 7 03:30:31 2015 +0000
6844: Skip uselessly writing unsigned manifest to Keep.
diff --git a/sdk/python/arvados/commands/arv_copy.py b/sdk/python/arvados/commands/arv_copy.py
index c5749cc..2543ad4 100755
--- a/sdk/python/arvados/commands/arv_copy.py
+++ b/sdk/python/arvados/commands/arv_copy.py
@@ -580,7 +580,6 @@ def copy_collection(obj_uuid, src, dst, args):
# Copy the manifest and save the collection.
logger.debug('saving %s with manifest: <%s>', obj_uuid, dst_manifest)
- dst_keep.put(dst_manifest.encode('utf-8'))
c['manifest_text'] = dst_manifest
return create_collection_from(c, src, dst, args)
commit d2d7138c84a55ef87937cdaefd9c58a66916d76f
Author: Tom Clegg <tom at clinicalfuture.com>
Date: Fri Aug 7 03:22:55 2015 +0000
6844: Return valid locator (hash+size) if 0 copies requested.
diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index b2700ae..63b99da 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -932,9 +932,10 @@ class KeepClient(object):
raise arvados.errors.ArgumentError("Argument 'data' to KeepClient.put is not type 'str'")
data_hash = hashlib.md5(data).hexdigest()
+ loc_s = data_hash + '+' + str(len(data))
if copies < 1:
- return data_hash
- locator = KeepLocator(data_hash + '+' + str(len(data)))
+ return loc_s
+ locator = KeepLocator(loc_s)
headers = {}
if self.using_proxy:
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list