Bug 1381745 - Wait for slow disks to write Safe Browsing lists to disk. r?whimboo draft
authorFrancois Marier <francois@mozilla.com>
Tue, 18 Jul 2017 16:51:56 -0700
changeset 610970 624405e3e61f18c1407e4c07c3ce4b2f9d92d1e1
parent 610649 dece50457378ac4934afe9fb3c2a8054e8894588
child 638022 a37d5daf2112b5287dd0c89fcf4b01b2f87e2cd8
push id69072
push userfmarier@mozilla.com
push dateWed, 19 Jul 2017 01:14:35 +0000
reviewerswhimboo
bugs1381745
milestone56.0a1
Bug 1381745 - Wait for slow disks to write Safe Browsing lists to disk. r?whimboo MozReview-Commit-ID: IopJ5iYzdK5
testing/firefox-ui/tests/functional/security/test_safe_browsing_initial_download.py
--- a/testing/firefox-ui/tests/functional/security/test_safe_browsing_initial_download.py
+++ b/testing/firefox-ui/tests/functional/security/test_safe_browsing_initial_download.py
@@ -1,13 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import os
+import time
 
 from firefox_puppeteer import PuppeteerMixin
 from marionette_driver import Wait
 from marionette_harness import MarionetteTestCase
 
 
 class TestSafeBrowsingInitialDownload(PuppeteerMixin, MarionetteTestCase):
 
@@ -96,16 +97,19 @@ class TestSafeBrowsingInitialDownload(Pu
         def check_downloaded(_):
             return reduce(lambda state, pref: state and int(self.marionette.get_pref(pref)) != 1,
                           self.prefs_provider_update_time.keys(), True)
 
         try:
             Wait(self.marionette, timeout=90).until(
                 check_downloaded, message='Not all safebrowsing files have been downloaded')
         finally:
+            # Wait for slow disks to finish writing the tables to disk
+            time.sleep(30)
+
             files_on_disk_toplevel = os.listdir(self.safebrowsing_path)
             for f in self.safebrowsing_v2_files:
                 self.assertIn(f, files_on_disk_toplevel)
 
             if len(self.safebrowsing_v4_files) > 0:
                 files_on_disk_google4 = os.listdir(os.path.join(self.safebrowsing_path, 'google4'))
                 for f in self.safebrowsing_v4_files:
                     self.assertIn(f, files_on_disk_google4)