Bug 416911 - per-test timeout in talos
timeout based upon browser activity p=anodelman r=rcampbell git-svn-id: svn://10.0.0.236/trunk@252844 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
516da31479
commit
2e4c4a159c
@ -109,6 +109,8 @@ def TerminateAllProcesses(*process_names):
|
||||
for process_name in process_names:
|
||||
# Get all the process ids of running instances of this process, and terminate them.
|
||||
try:
|
||||
# refresh list of processes
|
||||
win32pdh.EnumObjects(None, None, 0, 1)
|
||||
pids = win32pdhutil.FindPerformanceAttributesByName(process_name, counter="ID Process")
|
||||
for pid in pids:
|
||||
TerminateProcess(pid)
|
||||
|
||||
@ -58,12 +58,14 @@ dirs:
|
||||
env :
|
||||
NO_EM_RESTART : 1
|
||||
# Tests to run
|
||||
# url : (REQUIRED) url to load into the given firefox browser
|
||||
# url_mod : (OPTIONAL) a bit of code to be evaled and added to the given url during each cycle of the test
|
||||
# resolution: (REQUIRED) how long (in seconds) to pause between counter sampling
|
||||
# cycles : (REQUIRED) how many times to run the test
|
||||
# timeout : (OPTIONAL) how many seconds the test can run before we consider it failed and quit (default 8 hours)
|
||||
# counters : (REQUIRED) types of system activity to monitor during test run, can be empty
|
||||
# url : (REQUIRED) url to load into the given firefox browser
|
||||
# url_mod : (OPTIONAL) a bit of code to be evaled and added to the given url during each cycle of the test
|
||||
# resolution : (REQUIRED) how long (in seconds) to pause between counter sampling
|
||||
# cycles : (REQUIRED) how many times to run the test
|
||||
# timeout : (OPTIONAL) how many seconds the test can run before we consider it failed and quit (default 8 hours)
|
||||
# pagetimeout : (OPTIONAL) how many seconds each page is allowed to take before considered to be frozen (default 8 hours)
|
||||
# Must be used in conjuction with the pageloader with the -tpnoisy option
|
||||
# counters : (REQUIRED) types of system activity to monitor during test run, can be empty
|
||||
# For possible values of counters argument on Windows, see
|
||||
# http://technet2.microsoft.com/WindowsServer/en/Library/86b5d116-6fb3-427b-af8c-9077162125fe1033.mspx?mfr=true
|
||||
# Possible values on Linux and Mac:
|
||||
@ -80,12 +82,14 @@ tests :
|
||||
url_mod : str(int(time.time()*1000))
|
||||
resolution : 1
|
||||
cycles : 20
|
||||
timeout: 150
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
tp:
|
||||
url : '-tp page_load_test/manifest.txt -tpchrome -tpformat tinderbox -tpcycles 5'
|
||||
url : '-tp page_load_test/manifest.txt -tpchrome -tpformat -tpnoisy tinderbox -tpcycles 5'
|
||||
resolution : 1
|
||||
cycles : 1
|
||||
pagetimeout : 240
|
||||
win_counters : ['Working Set', 'Private Bytes', '% Processor Time']
|
||||
unix_counters : [ 'Private Bytes', 'RSS']
|
||||
tp_js:
|
||||
@ -95,39 +99,45 @@ tests :
|
||||
win_counters : ['Working Set', 'Private Bytes', '% Processor Time']
|
||||
unix_counters : [ 'Private Bytes', 'RSS']
|
||||
tdhtml:
|
||||
url: '-tp page_load_test/dhtml/dhtml.manifest -tpchrome -tpformat tinderbox -tpcycles 5'
|
||||
url: '-tp page_load_test/dhtml/dhtml.manifest -tpchrome -tpformat -tpnoisy tinderbox -tpcycles 5'
|
||||
resolution : 1
|
||||
cycles : 1
|
||||
pagetimeout : 240
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
tgfx:
|
||||
url: '-tp page_load_test/gfx/gfx.manifest -tpchrome -tpformat tinderbox -tpcycles 5 -tprender'
|
||||
url: '-tp page_load_test/gfx/gfx.manifest -tpchrome -tpformat -tpnoisy tinderbox -tpcycles 5 -tprender'
|
||||
resolution : 1
|
||||
cycles : 1
|
||||
pagetimeout : 240
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
tsvg:
|
||||
url: '-tp page_load_test/svg/svg.manifest -tpchrome -tpformat tinderbox -tpcycles 5'
|
||||
url: '-tp page_load_test/svg/svg.manifest -tpchrome -tpformat -tpnoisy tinderbox -tpcycles 5'
|
||||
resolution : 1
|
||||
cycles : 1
|
||||
pagetimeout : 240
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
twinopen:
|
||||
url: startup_test/twinopen/winopen.xul?phase1=20
|
||||
resolution: 1
|
||||
cycles : 1
|
||||
timeout : 300
|
||||
win_counters: []
|
||||
unix_counters : []
|
||||
tjss:
|
||||
url: '-tp page_load_test/jss/jss.manifest -tpchrome -tpformat tinderbox -tpcycles 1'
|
||||
url: '-tp page_load_test/jss/jss.manifest -tpchrome -tpformat -tpnoisy tinderbox -tpcycles 1'
|
||||
resolution : 1
|
||||
cycles : 1
|
||||
pagetimeout : 240
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
tsspider:
|
||||
url: '-tp page_load_test/sunspider/sunspider.manifest -tpchrome -tpformat tinderbox -tpcycles 5'
|
||||
url: '-tp page_load_test/sunspider/sunspider.manifest -tpchrome -tpformat -tpnoisy tinderbox -tpcycles 5'
|
||||
resolution : 1
|
||||
cycles : 1
|
||||
pagetimeout : 240
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
|
||||
|
||||
@ -173,6 +173,10 @@ def runTest(browser_config, test_config):
|
||||
timeout = test_config['timeout']
|
||||
else:
|
||||
timeout = 28800 # 8 hours
|
||||
if 'pagetimeout' in test_config:
|
||||
pagetimeout = test_config['pagetimeout']
|
||||
else:
|
||||
pagetimeout = 28800 # 8 hours
|
||||
total_time = 0
|
||||
output = ''
|
||||
url = test_config['url']
|
||||
@ -198,10 +202,12 @@ def runTest(browser_config, test_config):
|
||||
counter_results[counter] = []
|
||||
|
||||
busted = False
|
||||
lastNoise = 0
|
||||
while total_time < timeout:
|
||||
# Sleep for [resolution] seconds
|
||||
time.sleep(resolution)
|
||||
total_time += resolution
|
||||
lastNoise += resolution
|
||||
|
||||
# Get the output from all the possible counters
|
||||
for count_type in counters:
|
||||
@ -217,6 +223,7 @@ def runTest(browser_config, test_config):
|
||||
if match:
|
||||
if match.group(1):
|
||||
utils.noisy(match.group(1))
|
||||
lastNoise = 0
|
||||
match = RESULTS_REGEX.search(output)
|
||||
if match:
|
||||
browser_results += match.group(1)
|
||||
@ -243,6 +250,9 @@ def runTest(browser_config, test_config):
|
||||
if (total_time % 60 == 0):
|
||||
if not checkBrowserAlive():
|
||||
busted = True
|
||||
|
||||
if lastNoise > pagetimeout:
|
||||
raise talosError("browser frozen")
|
||||
|
||||
if total_time >= timeout:
|
||||
raise talosError("timeout exceeded")
|
||||
|
||||
@ -55,7 +55,7 @@ def noisy(message):
|
||||
these are ignored. Controlled through command line switch (-n or --noisy)
|
||||
"""
|
||||
if NOISY == 1:
|
||||
print "NOISE: " + message
|
||||
print "NOISE: " + message.strip().replace('\n', '\nNOISE: ')
|
||||
|
||||
def debug(message):
|
||||
"""Prints a debug message to the console if the DEBUG switch is turned on
|
||||
@ -64,7 +64,7 @@ def debug(message):
|
||||
message: string containing a debugging statement
|
||||
"""
|
||||
if DEBUG == 1:
|
||||
print "DEBUG: " + message
|
||||
print "DEBUG: " + message.strip().replace('\n', '\nDEBUG: ')
|
||||
|
||||
def stamped_msg(msg_title, msg_action):
|
||||
"""Prints a message to the console with a time stamp
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user