Bug 1033033 - Don't access the device_manager during __init__. r=mdas, a=2.0+
authorJonathan Griffin <jgriffin@mozilla.com>
Wed, 02 Jul 2014 15:23:10 -0700
changeset 207648 4c30346e553b505471ea075625b03e2b4f364283
parent 207647 b5f91ccf9fd16ae5060c589300c16e5aa522443a
child 207649 338986681aaa9ef2281354b44ac16aaa00048788
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmdas, 2
bugs1033033
milestone32.0a2
Bug 1033033 - Don't access the device_manager during __init__. r=mdas, a=2.0+
testing/marionette/client/marionette/runner/mixins/endurance.py
--- a/testing/marionette/client/marionette/runner/mixins/endurance.py
+++ b/testing/marionette/client/marionette/runner/mixins/endurance.py
@@ -128,33 +128,38 @@ class EnduranceTestCaseMixin(object):
         for function in self.process_checkpoint_functions:
             function()
 
 
 class MemoryEnduranceTestCaseMixin(object):
 
     def __init__(self, *args, **kwargs):
         # TODO: add desktop support
-        if self.device_manager:
-            self.add_checkpoint_function(self.memory_b2g_checkpoint)
-            self.add_process_checkpoint_function(self.memory_b2g_process_checkpoint)
+        self.add_checkpoint_function(self.memory_b2g_checkpoint)
+        self.add_process_checkpoint_function(self.memory_b2g_process_checkpoint)
 
     def memory_b2g_checkpoint(self):
+        if not self.device_manager:
+            return
+
         # Sleep to give device idle time (for gc)
         idle_time = 30
         self.marionette.log("sleeping %d seconds to give the device some idle time" % idle_time)
         time.sleep(idle_time)
 
         # Dump out some memory status info
         self.marionette.log("checkpoint")
         output_str = self.device_manager.shellCheckOutput(["b2g-ps"])
         with open(self.log_name, 'a') as log_file:
             log_file.write('%s\n' % output_str)
 
     def memory_b2g_process_checkpoint(self):
+        if not self.device_manager:
+            return
+
         # Process checkpoint data into .json
         self.marionette.log("processing checkpoint data from %s" % self.log_name)
 
         # Open the checkpoint file
         checkpoint_file = open(self.log_name, 'r')
 
         # Grab every b2g rss reading for each checkpoint
         b2g_rss_list = []