Bug 1532550 - Wait for 0.1 seconds in telemetry-tests-client tests after performing search; r=janerik
authorRaphael Pierzina <rpierzina@mozilla.com>
Tue, 14 May 2019 09:54:33 +0000
changeset 473747 18ce39639db8395584fb8dbd8fc0927c90228291
parent 473746 ca347ea97ee31b859bc250936cf6e4256198c516
child 473748 2742b0a517fb324dca5d5968a8d4556db2209f34
push id36013
push usercsabou@mozilla.com
push dateTue, 14 May 2019 16:01:08 +0000
treeherdermozilla-central@230016dbba05 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanerik
bugs1532550
milestone68.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 1532550 - Wait for 0.1 seconds in telemetry-tests-client tests after performing search; r=janerik Differential Revision: https://phabricator.services.mozilla.com/D30944
toolkit/components/telemetry/tests/marionette/harness/telemetry_harness/testcase.py
--- a/toolkit/components/telemetry/tests/marionette/harness/telemetry_harness/testcase.py
+++ b/toolkit/components/telemetry/tests/marionette/harness/telemetry_harness/testcase.py
@@ -1,16 +1,17 @@
 # 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 contextlib
 import os
 import re
 import textwrap
+import time
 
 from marionette_driver.addons import Addons
 from marionette_driver.errors import MarionetteException
 from marionette_driver.wait import Wait
 from marionette_driver import By, keys
 from marionette_harness import MarionetteTestCase
 from marionette_harness.runner.mixins.window_manager import WindowManagerMixin
 
@@ -61,16 +62,20 @@ class TelemetryTestCase(WindowManagerMix
     def search(self, text):
         """Perform a search via the browser's URL bar."""
 
         with self.marionette.using_context(self.marionette.CONTEXT_CHROME):
             urlbar = self.marionette.find_element(By.ID, "urlbar")
             urlbar.send_keys(keys.Keys.DELETE)
             urlbar.send_keys(text + keys.Keys.ENTER)
 
+        # Wait for 0.1 seconds before proceeding to decrease the chance
+        # of Firefox being shut down before Telemetry is recorded
+        time.sleep(0.1)
+
     def search_in_new_tab(self, text):
         """Open a new tab and perform a search via the browser's URL bar,
         then close the new tab."""
 
         with self.new_tab():
             self.search(text)
 
     def assertIsValidUUID(self, value):