Work in progress on fixing test_periodic_full_scan.
authorDavid Stainton <dstainton415@gmail.com>
Wed, 27 Jan 2016 15:43:02 +0000 (15:43 +0000)
committerDavid Stainton <dstainton415@gmail.com>
Wed, 27 Jan 2016 15:43:02 +0000 (15:43 +0000)
src/allmydata/test/test_magic_folder.py

index 4bfddbe0c67db1983b2c5d86e47c6fda01cf6f78..383a41ca14f199a427701f75241ff31cf59a1369 100644 (file)
@@ -1231,18 +1231,18 @@ class MockTest(MagicFolderTestMixin, unittest.TestCase):
 
         def _create_file_without_event(res):
             print "CREATE FILE WITHOUT EMITTING EVENT"
-            uploaded_d = self.magicfolder.uploader.set_hook('processed')
+            processed_d = self.magicfolder.uploader.set_hook('processed')
             what_path = abspath_expanduser_unicode(u"what", base=new_empty_tree_dir)
             fileutil.write(what_path, "say when")
             print "ADVANCE CLOCK"
-            #alice_clock.advance(self.magicfolder.uploader._periodic_full_scan_duration + 1)
-            return uploaded_d
+            alice_clock.advance(self.magicfolder.uploader._periodic_full_scan_duration + 1)
+            return processed_d
         d.addCallback(_create_file_without_event)
         def _advance_clock(res):
             print "_advance_clock"
-            alice_clock.advance(self.magicfolder.uploader._periodic_full_scan_duration + 1)
-        d.addCallback(_advance_clock)
-        d.addCallback(_advance_clock)
+            processed_d = self.magicfolder.uploader.set_hook('processed')
+            alice_clock.advance(0)
+            return processed_d
         d.addCallback(_advance_clock)
         d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('uploader.files_uploaded'), 1))
         d.addCallback(lambda ign: self.magicfolder.finish())