From: meejah Date: Thu, 8 Oct 2015 02:32:19 +0000 (-0600) Subject: Make downloader delay a class-variable X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/something?a=commitdiff_plain;h=c2464bb210c7b641855f1cf7b684838a6619b5d8;p=tahoe-lafs%2Ftahoe-lafs.git Make downloader delay a class-variable This gives the integration-style CLI-based tests a chance to set the delay to 0 before the first 3-second delayed call is queued to _lazy_tail in the Downloader --- diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index 422a7c11..b6a9476f 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -378,6 +378,8 @@ class Uploader(QueueMixin): class Downloader(QueueMixin): + REMOTE_SCAN_INTERVAL = 3 # facilitates tests + def __init__(self, client, local_path_u, db, collective_dircap, clock): QueueMixin.__init__(self, client, local_path_u, db, 'downloader', clock) @@ -389,7 +391,7 @@ class Downloader(QueueMixin): if self._collective_dirnode.is_unknown() or not self._collective_dirnode.is_readonly(): raise AssertionError("The URI in 'private/collective_dircap' is not a readonly cap to a directory.") - self._turn_delay = 3 # delay between remote scans + self._turn_delay = self.REMOTE_SCAN_INTERVAL self._download_scan_batch = {} # path -> [(filenode, metadata)] def start_scanning(self): diff --git a/src/allmydata/test/test_magic_folder.py b/src/allmydata/test/test_magic_folder.py index 75511b79..5e2afa00 100644 --- a/src/allmydata/test/test_magic_folder.py +++ b/src/allmydata/test/test_magic_folder.py @@ -31,6 +31,7 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual temp = self.mktemp() self.basedir = abspath_expanduser_unicode(temp.decode(get_filesystem_encoding())) self.magicfolder = None + Downloader.REMOTE_SCAN_INTERVAL = 0 def _get_count(self, name, client=None): counters = (client or self.get_client()).stats_provider.get_stats()["counters"]