Bug 797339 - Talos ts_shutdown numbers look bogus, test takes >80 minutes. r=jhammel
authorJoel Maher <jmaher@mozilla.com>
Thu, 04 Oct 2012 12:36:27 -0400
changeset 537 97cbf16e98465138e5a42d025186d95c7a0c9587
parent 536 7d1383f80c37a1165e4d173f6f93dafa87bb555c
child 538 babd4748ce0bdfee1ae2b331846e9508ca231735
push id285
push userjmaher@mozilla.com
push dateThu, 04 Oct 2012 16:36:58 +0000
reviewersjhammel
bugs797339
Bug 797339 - Talos ts_shutdown numbers look bogus, test takes >80 minutes. r=jhammel
talos/ttest.py
--- a/talos/ttest.py
+++ b/talos/ttest.py
@@ -286,17 +286,20 @@ class TTest(object):
             test_results = results.TestResults(test_config, global_counters, extensions=self._ffsetup.extensions)
 
             for i in range(test_config['cycles']):
 
                 # remove the browser log file
                 if os.path.isfile(browser_config['browser_log']):
                     os.chmod(browser_config['browser_log'], 0777)
                     os.remove(browser_config['browser_log'])
-                time.sleep(browser_config['browser_wait']) #wait out the browser closing
+
+                # on remote devices we do not have the fast launch/shutdown as we do on desktop
+                if not browser_config['remote']:
+                    time.sleep(browser_config['browser_wait']) #wait out the browser closing
 
                 # check to see if the previous cycle is still hanging around
                 if (i > 0) and self._ffprocess.checkAllProcesses(browser_config['process'], browser_config['child_process']):
                     raise talosError("previous cycle still running")
 
                 # Run the test
                 timeout = test_config.get('timeout', 7200) # 2 hours default
                 total_time = 0
@@ -319,28 +322,29 @@ class TTest(object):
                     process = subprocess.Popen(b_cmd, universal_newlines=True, bufsize=0, env=os.environ)
                 except:
                     raise talosError("error executing browser command line '%s': %s" % (subprocess.list2cmdline(cmd), sys.exc_info()[0]))
 
                 #give browser a chance to open
                 # this could mean that we are losing the first couple of data points
                 # as the tests starts, but if we don't provide
                 # some time for the browser to start we have trouble connecting the CounterManager to it
-                time.sleep(browser_config['browser_wait'])
+                # on remote devices we do not have the fast launch/shutdown as we do on desktop
+                if not browser_config['remote']:
+                    time.sleep(browser_config['browser_wait'])
 
                 #set up the counters for this test
                 counter_results = None
                 if counters:
                     cm = self.CounterManager(self._ffprocess, browser_config['process'], counters)
                     counter_results = dict([(counter, []) for counter in counters])
 
                 #the main test loop, monitors counters and checks for browser output
                 dumpResult = ""
                 while total_time < timeout:
-
                     # Sleep for [resolution] seconds
                     time.sleep(resolution)
                     total_time += resolution
                     fileData = self._ffprocess.getFile(b_log)
                     if len(fileData) > 0:
                         utils.noisy(fileData.replace(dumpResult, ''))
                         dumpResult = fileData
 
@@ -372,17 +376,20 @@ class TTest(object):
                 # ensure the browser log exists
                 browser_log_filename = browser_config['browser_log']
                 if not os.path.isfile(browser_log_filename):
                     raise talosError("no output from browser [%s]" % browser_log_filename)
 
                 # add the results from the browser output
                 test_results.add(browser_log_filename, counter_results=counter_results)
 
-                time.sleep(browser_config['browser_wait'])
+                # on remote devices we do not have the fast launch/shutdown as we do on desktop
+                if not browser_config['remote']:
+                    time.sleep(browser_config['browser_wait'])
+
                 #clean up any stray browser processes
                 self.cleanupAndCheckForCrashes(browser_config, profile_dir)
                 #clean up the bcontroller process
                 timer = 0
                 while ((process.poll() is None) and timer < browser_config['browser_wait']):
                     time.sleep(1)
                     timer+=1