From: David Stainton Date: Tue, 26 May 2015 15:10:21 +0000 (-0700) Subject: Add sleep to test X-Git-Url: https://git.rkrishnan.org/vdrive/%22file:/status?a=commitdiff_plain;h=23688b236bf6bbfad771b03a1096bbcf44e3a804;p=tahoe-lafs%2Ftahoe-lafs.git Add sleep to test --- diff --git a/src/allmydata/test/test_drop_upload.py b/src/allmydata/test/test_drop_upload.py index 186a8763..424c498d 100644 --- a/src/allmydata/test/test_drop_upload.py +++ b/src/allmydata/test/test_drop_upload.py @@ -251,7 +251,7 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.objects_queued'), 0)) d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.directories_created'), 1)) - def _move_dir_away(): + def _move_dir_away(ign): os.rename(new_empty_tree_dir, empty_tree_dir) # XXX mock notify event #self.notify_close_write(to_filepath(new_empty_tree_dir)) @@ -266,6 +266,9 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA #self.notify_close_write(to_filepath(test_file)) return d2 d.addCallback(create_file) + def sleep_a_while(ign): + time.sleep(3) + d.addCallback(sleep_a_while) d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.objects_uploaded'), 1)) d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.files_uploaded'), 0)) d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.objects_queued'), 0))