Bug 1141519: if we try call marionette calls in the teardown and they don't work we should just carry on; r=jgriffin
authorDavid Burns <dburns@mozilla.com>
Wed, 16 Sep 2015 20:58:28 +0100
changeset 263598 88386ed1886c6e811b58690cf0adf3f4429d7857
parent 263597 6d92fc2898e9b9232d1642526a4f7eb25718fbae
child 263599 d30c70405a0e1283db5a547a566222b08e6a3060
push id65361
push userdburns@mozilla.com
push dateMon, 21 Sep 2015 20:10:41 +0000
treeherdermozilla-inbound@88386ed1886c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs1141519
milestone44.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 1141519: if we try call marionette calls in the teardown and they don't work we should just carry on; r=jgriffin
testing/marionette/client/marionette/marionette_test.py
--- a/testing/marionette/client/marionette/marionette_test.py
+++ b/testing/marionette/client/marionette/marionette_test.py
@@ -686,20 +686,27 @@ class MarionetteTestCase(CommonTestCase)
     def setUp(self):
         CommonTestCase.setUp(self)
         self.marionette.test_name = self.test_name
         self.marionette.execute_script("log('TEST-START: %s:%s')" %
                                        (self.filepath.replace('\\', '\\\\'), self.methodName))
 
     def tearDown(self):
         if not self.marionette.check_for_crash():
-           self.marionette.clear_imported_scripts()
-           self.marionette.execute_script("log('TEST-END: %s:%s')" %
-                                          (self.filepath.replace('\\', '\\\\'), self.methodName))
-        self.marionette.test_name = None
+            try:
+                self.marionette.clear_imported_scripts()
+                self.marionette.execute_script("log('TEST-END: %s:%s')" %
+                                               (self.filepath.replace('\\', '\\\\'),
+                                                self.methodName))
+                self.marionette.test_name = None
+            except:
+                # We have tried to log the test end when there is no listener
+                # object that we can access
+                pass
+
         CommonTestCase.tearDown(self)
 
     def get_new_emulator(self):
         self.extra_emulator_index += 1
         if len(self.marionette.extra_emulators) == self.extra_emulator_index:
             qemu  = Marionette(emulator=self.marionette.emulator.arch,
                                emulatorBinary=self.marionette.emulator.binary,
                                homedir=self.marionette.homedir,