diff --git a/s3tests/common/greenlets.py b/s3tests/common/greenlets.py index 885ee3d..8ed90ac 100644 --- a/s3tests/common/greenlets.py +++ b/s3tests/common/greenlets.py @@ -9,6 +9,7 @@ from ..common import context, get_next_key from ..common.results import TransferGreenletResult from ..realistic import FileVerifier + # Make sure context has somewhere to store what we need context.update(bunch.Bunch( neads_first_read = collections.deque(), @@ -16,6 +17,7 @@ context.update(bunch.Bunch( files_iter = None, )) + class SafeTransferGreenlet(gevent.Greenlet): def __init__(self, timeout=120): gevent.Greenlet.__init__(self) diff --git a/s3tests/realistic.py b/s3tests/realistic.py index 6a51a4c..f4a3ddf 100644 --- a/s3tests/realistic.py +++ b/s3tests/realistic.py @@ -25,8 +25,7 @@ class RandomContentFile(object): ) def _mark_chunk(self): - ctime = time.time() - self.chunks.append([self.offset, (ctime - self.last_seek) * 1000000000, ctime]) + self.chunks.append([self.offset, (time.time() - self.last_seek) * 1000000000]) def seek(self, offset): assert offset == 0 @@ -37,8 +36,8 @@ class RandomContentFile(object): self.hash = hashlib.md5() self.digest_size = self.hash.digest_size self.digest = None - - # Save the last seek time as our start time, and the last chunks + + # Save the last seek time as our start time, and the last chunks self.start_time = self.last_seek self.last_chunks = self.chunks # Before emptying. @@ -96,8 +95,7 @@ class FileVerifier(object): self.chunks = [] def _mark_chunk(self): - ctime = time.time() - self.chunks.append([self.size, (ctime - self.created_at) * 1000000000, ctime]) + self.chunks.append([self.size, (time.time() - self.created_at) * 1000000000]) def write(self, data): self.size += len(data)