From 6c41b01fa8162099474748e220bbdc92938eb5e2 Mon Sep 17 00:00:00 2001 From: "anodelman%mozilla.com" Date: Sat, 18 Apr 2009 19:47:31 +0000 Subject: [PATCH] Bug 480413 - design test to monitor browser shut down time p/r=anodelman, possible fix for race condition on mac git-svn-id: svn://10.0.0.236/trunk@256972 18797224-902f-48f8-a5cc-f745e15eee43 --- .../testing/performance/talos/bcontroller.py | 1 + mozilla/testing/performance/talos/ttest.py | 56 +++++++++---------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/mozilla/testing/performance/talos/bcontroller.py b/mozilla/testing/performance/talos/bcontroller.py index 4ab33109ebf..c8514e5916b 100644 --- a/mozilla/testing/performance/talos/bcontroller.py +++ b/mozilla/testing/performance/talos/bcontroller.py @@ -123,6 +123,7 @@ class BrowserController: return results_file.write("__startSecondTimestamp%d__endSecondTimestamp\n" % self.bwaiter.getTime()) results_file.close() + return def main(argv=None): diff --git a/mozilla/testing/performance/talos/ttest.py b/mozilla/testing/performance/talos/ttest.py index c28926dd7c4..9b69e9aa562 100644 --- a/mozilla/testing/performance/talos/ttest.py +++ b/mozilla/testing/performance/talos/ttest.py @@ -228,35 +228,35 @@ def runTest(browser_config, test_config): val = cm.getCounterValue(count_type) if (val): counter_results[count_type].append(val) - if process.poll() != None: #browser_controller completed, file now full - if not os.path.isfile(browser_config['browser_log']): - raise talosError("no output from browser") - results_file = open(browser_config['browser_log'], "r") - results_raw = results_file.read() - results_file.close() - utils.noisy(results_raw) + if not os.path.isfile(browser_config['browser_log']): + raise talosError("no output from browser") + results_file = open(browser_config['browser_log'], "r") + results_raw = results_file.read() + results_file.close() - match = RESULTS_REGEX.search(results_raw) - if match: - browser_results += match.group(1) - startTime = int(match.group(2)) - endTime = int(match.group(3)) - utils.debug("Matched basic results: " + browser_results) - break - #TODO: this a stop gap until all of the tests start outputting the same format - match = RESULTS_TP_REGEX.search(results_raw) - if match: - browser_results += match.group(1) - startTime = int(match.group(2)) - endTime = int(match.group(3)) - utils.debug("Matched tp results: " + browser_results) - break - match = RESULTS_REGEX_FAIL.search(results_raw) - if match: - browser_results += match.group(1) - utils.debug("Matched fail results: " + browser_results) - raise talosError(match.group(1)) - raise talosError("unrecognized output format") + match = RESULTS_REGEX.search(results_raw) + if match: + utils.noisy(results_raw) + browser_results += match.group(1) + startTime = int(match.group(2)) + endTime = int(match.group(3)) + utils.debug("Matched basic results: " + browser_results) + break + #TODO: this a stop gap until all of the tests start outputting the same format + match = RESULTS_TP_REGEX.search(results_raw) + if match: + utils.noisy(results_raw) + browser_results += match.group(1) + startTime = int(match.group(2)) + endTime = int(match.group(3)) + utils.debug("Matched tp results: " + browser_results) + break + match = RESULTS_REGEX_FAIL.search(results_raw) + if match: + utils.noisy(results_raw) + browser_results += match.group(1) + utils.debug("Matched fail results: " + browser_results) + raise talosError(match.group(1)) if total_time >= timeout: raise talosError("timeout exceeded")