Bug 1533056 - Move test_startup_caches out of marionette unit tests r=whimboo
authorDoug Thayer <dothayer@mozilla.com>
Thu, 07 Mar 2019 06:30:38 +0000
changeset 520848 e2bfdeaf11bddaa79f28ad81921d13c7aac9914e
parent 520847 7450a570330eb18ff2bd23f129e44566c964fb0b
child 520849 8a15f91d48c7541337d16c5e3f6f4551e7371e3d
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1533056
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1533056 - Move test_startup_caches out of marionette unit tests r=whimboo Renamed the test to reflect that it is really just a test of the script preloader as well. I just moved it to get it close to the ScriptPreloader and near existing tests. Differential Revision: https://phabricator.services.mozilla.com/D22330
js/xpconnect/tests/marionette/manifest.ini
js/xpconnect/tests/marionette/test_preloader_telemetry.py
testing/marionette/harness/marionette_harness/tests/unit/test_startup_caches.py
testing/marionette/harness/marionette_harness/tests/unit/unit-tests.ini
--- a/js/xpconnect/tests/marionette/manifest.ini
+++ b/js/xpconnect/tests/marionette/manifest.ini
@@ -1,3 +1,6 @@
 
 [test_loader_global_sharing.py]
 skip-if = !manage_instance || appname == 'fennec'
+
+[test_preloader_telemetry.py]
+skip-if = appname == 'fennec'
rename from testing/marionette/harness/marionette_harness/tests/unit/test_startup_caches.py
rename to js/xpconnect/tests/marionette/test_preloader_telemetry.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_startup_caches.py
+++ b/js/xpconnect/tests/marionette/test_preloader_telemetry.py
@@ -22,18 +22,20 @@ class TestScriptPreloader(MarionetteTest
         histogram = self.get_histogram("SCRIPT_PRELOADER_REQUESTS")
         misses = histogram.get(LABELS_SCRIPT_PRELOADER_REQUESTS["Miss"], 0)
         hits = histogram.get(LABELS_SCRIPT_PRELOADER_REQUESTS["Hit"], 0)
         child_hits = histogram.get(LABELS_SCRIPT_PRELOADER_REQUESTS["HitChild"], 0)
         self.assertMuchGreaterThan(misses, hits)
         self.assertMuchGreaterThan(misses, child_hits)
 
         profile = self.marionette.profile_path
-        self.wait_for_file_change(start_time, "{}/startupCache/scriptCache.bin".format(profile))
-        self.wait_for_file_change(start_time, "{}/startupCache/scriptCache-child.bin".format(profile))
+        self.wait_for_file_change(start_time,
+                                  "{}/startupCache/scriptCache.bin".format(profile))
+        self.wait_for_file_change(start_time,
+                                  "{}/startupCache/scriptCache-child.bin".format(profile))
         self.marionette.restart(clean=False, in_app=True)
         histogram = self.get_histogram("SCRIPT_PRELOADER_REQUESTS")
         misses = histogram.get(LABELS_SCRIPT_PRELOADER_REQUESTS["Miss"], 0)
         hits = histogram.get(LABELS_SCRIPT_PRELOADER_REQUESTS["Hit"], 0)
         child_hits = histogram.get(LABELS_SCRIPT_PRELOADER_REQUESTS["HitChild"], 0)
         # This is just heuristic. We certainly want to be made aware if this ratio
         # changes and we didn't intend it to.
         self.assertSimilar(misses, hits)
@@ -48,22 +50,21 @@ class TestScriptPreloader(MarionetteTest
 
     def wait_for_file_change(self, start_time, path):
         expires = time.time() + 20
         while True:
             try:
                 if os.stat(path).st_mtime > start_time:
                     return
                 if time.time() > expires:
-                    raise Error("Never observed file change for {}".format(path))
+                    raise Exception("Never observed file change for {}".format(path))
                 time.sleep(1)
             except OSError:
                 pass
 
-
     def wait_for_observer_notification(self, name):
         with self.marionette.using_context(self.marionette.CONTEXT_CHROME):
             return self.marionette.execute_script("""
                 let [resolve] = arguments;
                 Services.obs.addObserver(() => resolve(), "{}");
             """.format(name))
 
     def get_histogram(self, name):
--- a/testing/marionette/harness/marionette_harness/tests/unit/unit-tests.ini
+++ b/testing/marionette/harness/marionette_harness/tests/unit/unit-tests.ini
@@ -123,11 +123,8 @@ skip-if = appname == 'fennec' # Bug 1330
 
 [test_select.py]
 [test_crash.py]
 skip-if = asan || manage_instance == false || appname == 'fennec' # Bug 1298921
 [test_localization.py]
 
 [test_reftest.py]
 skip-if = appname == 'fennec' # Bug 1519552
-
-[test_startup_caches.py]
-skip-if = appname == 'fennec'