bug 537147 (Talos orange: "Busted: tp4" "failed to initialize browser" with message about firefox being terminated) p=anodelman r=catlee
git-svn-id: svn://10.0.0.236/trunk@259502 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -121,7 +121,7 @@ class FFProcess(object):
|
||||
|
||||
def cleanupProcesses(self, process_name, child_process, browser_wait):
|
||||
#kill any remaining browser processes
|
||||
self.TerminateAllProcesses(browser_wait, process_name, "crashreporter", "dwwin", "talkback")
|
||||
self.TerminateAllProcesses(browser_wait, process_name, child_process, "crashreporter", "dwwin", "talkback")
|
||||
#check if anything is left behind
|
||||
if self.checkAllProcesses(process_name, child_process):
|
||||
#this is for windows machines. when attempting to send kill messages to win processes the OS
|
||||
|
||||
@@ -142,7 +142,7 @@ class FFSetup(object):
|
||||
else:
|
||||
utils.debug("WARNING: file already installed (" + fromfile + ")")
|
||||
|
||||
def InitializeNewProfile(self, browser_path, process, browser_wait, extra_args, profile_dir, init_url, log):
|
||||
def InitializeNewProfile(self, browser_path, process, child_process, browser_wait, extra_args, profile_dir, init_url, log):
|
||||
"""Runs browser with the new profile directory, to negate any performance
|
||||
hit that could occur as a result of starting up with a new profile.
|
||||
Also kills the "extra" browser that gets spawned the first time browser
|
||||
@@ -154,7 +154,7 @@ class FFSetup(object):
|
||||
"""
|
||||
PROFILE_REGEX = re.compile('__metrics(.*)__metrics', re.DOTALL|re.MULTILINE)
|
||||
command_line = self.ffprocess.GenerateBrowserCommandLine(browser_path, extra_args, profile_dir, init_url)
|
||||
process = subprocess.Popen('python bcontroller.py --command "%s" --name %s --timeout %d --log %s' % (command_line, process, browser_wait, log), universal_newlines=True, shell=True, bufsize=0, env=os.environ)
|
||||
process = subprocess.Popen('python bcontroller.py --command "%s" --name %s --child_process %s --timeout %d --log %s' % (command_line, process, child_process, browser_wait, log), universal_newlines=True, shell=True, bufsize=0, env=os.environ)
|
||||
res = 0
|
||||
total_time = 0
|
||||
while total_time < 600: #10 minutes
|
||||
|
||||
@@ -109,6 +109,7 @@ class TTest(object):
|
||||
def initializeProfile(self, profile_dir, browser_config):
|
||||
if not (self._ffsetup.InitializeNewProfile(browser_config['browser_path'],
|
||||
browser_config['process'],
|
||||
browser_config['child_process'],
|
||||
browser_config['browser_wait'],
|
||||
browser_config['extra_args'],
|
||||
profile_dir,
|
||||
@@ -116,7 +117,7 @@ class TTest(object):
|
||||
browser_config['browser_log'])):
|
||||
raise talosError("failed to initialize browser")
|
||||
time.sleep(browser_config['browser_wait'])
|
||||
if self._ffprocess.checkAllProcesses(browser_config['process'], browser_config['process']):
|
||||
if self._ffprocess.checkAllProcesses(browser_config['process'], browser_config['child_process']):
|
||||
raise talosError("browser failed to close after being initialized")
|
||||
|
||||
def cleanupProfile(self, dir):
|
||||
@@ -193,12 +194,12 @@ class TTest(object):
|
||||
browser_config['dirs'][dir])
|
||||
|
||||
# make profile path work cross-platform
|
||||
test_config['profile_path'] = os.path.normpath(test_config['profile_path'])
|
||||
profile_dir, temp_dir = self.createProfile(test_config['profile_path'], browser_config)
|
||||
if os.path.isfile(browser_config['browser_log']):
|
||||
os.chmod(browser_config['browser_log'], 0777)
|
||||
os.remove(browser_config['browser_log'])
|
||||
self.initializeProfile(profile_dir, browser_config)
|
||||
test_config['profile_path'] = os.path.normpath(test_config['profile_path'])
|
||||
profile_dir, temp_dir = self.createProfile(test_config['profile_path'], browser_config)
|
||||
if os.path.isfile(browser_config['browser_log']):
|
||||
os.chmod(browser_config['browser_log'], 0777)
|
||||
os.remove(browser_config['browser_log'])
|
||||
self.initializeProfile(profile_dir, browser_config)
|
||||
|
||||
utils.debug("initialized " + browser_config['process'])
|
||||
if test_config['shutdown']:
|
||||
|
||||
Reference in New Issue
Block a user