Skip to content

Commit ea8b331

Browse files
committed
Improve Firefox browser process tracking by using the -wait-for-browser cmdline arg, and waiting longer for process startup.
1 parent 3b5d9ec commit ea8b331

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def configure(data_dir):
137137

138138
class FirefoxConfig:
139139
data_dir_flag = '-profile '
140-
default_flags = ('-new-instance',)
140+
default_flags = ('-new-instance', '-wait-for-browser')
141141
headless_flags = '-headless'
142142
executable_name = utils.exe_suffix('firefox')
143143

@@ -2081,13 +2081,13 @@ def launch_browser_harness_with_proc_snapshot_workaround(cls, parallel_harness,
20812081
# Give the browser time to spawn its subprocesses. Use an increasing
20822082
# timeout as a crude way to account for system load.
20832083
if parallel_harness or is_safari():
2084-
time.sleep(min(2 + count * 0.3, 10))
2084+
time.sleep(min(5 + count * 0.3, 10))
20852085
procs_after = list_processes_by_name(config.executable_name)
20862086

20872087
# Take a snapshot again to find which processes exist after launching
20882088
# the browser. Then the newly launched browser processes are determined
20892089
# by the delta before->after.
2090-
cls.browser_procs = list(set(procs_after).difference(set(procs_before)))
2090+
cls.browser_procs += list(set(procs_after).difference(set(procs_before)))
20912091
if len(cls.browser_procs) == 0:
20922092
exit_with_error('Could not detect the launched browser subprocesses. The test harness will not be able to close the browser after testing is done, so aborting the test run here.')
20932093

0 commit comments

Comments
 (0)