From ea8b331f62b80c96258dbee1fcfd173b1765a89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Fri, 24 Oct 2025 22:32:28 +0300 Subject: [PATCH 1/4] Improve Firefox browser process tracking by using the -wait-for-browser cmdline arg, and waiting longer for process startup. --- test/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/common.py b/test/common.py index 41be6a654a3dc..24431a8cf9bbd 100644 --- a/test/common.py +++ b/test/common.py @@ -137,7 +137,7 @@ def configure(data_dir): class FirefoxConfig: data_dir_flag = '-profile ' - default_flags = ('-new-instance',) + default_flags = ('-new-instance', '-wait-for-browser') headless_flags = '-headless' executable_name = utils.exe_suffix('firefox') @@ -2081,13 +2081,13 @@ def launch_browser_harness_with_proc_snapshot_workaround(cls, parallel_harness, # Give the browser time to spawn its subprocesses. Use an increasing # timeout as a crude way to account for system load. if parallel_harness or is_safari(): - time.sleep(min(2 + count * 0.3, 10)) + time.sleep(min(5 + count * 0.3, 10)) procs_after = list_processes_by_name(config.executable_name) # Take a snapshot again to find which processes exist after launching # the browser. Then the newly launched browser processes are determined # by the delta before->after. - cls.browser_procs = list(set(procs_after).difference(set(procs_before))) + cls.browser_procs += list(set(procs_after).difference(set(procs_before))) if len(cls.browser_procs) == 0: 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.') From d8680d8b9506bee84cac45b5618680cebe0532c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Sat, 25 Oct 2025 11:54:36 +0300 Subject: [PATCH 2/4] Linux workaround --- test/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/common.py b/test/common.py index 24431a8cf9bbd..62564f5aa2054 100644 --- a/test/common.py +++ b/test/common.py @@ -30,6 +30,7 @@ from subprocess import PIPE, STDOUT from typing import Dict, Tuple from urllib.parse import parse_qs, unquote, unquote_plus, urlparse +from .utils import LINUX import clang_native import jsrun @@ -137,7 +138,7 @@ def configure(data_dir): class FirefoxConfig: data_dir_flag = '-profile ' - default_flags = ('-new-instance', '-wait-for-browser') + default_flags = ('-new-instance',) if LINUX else ('-new-instance', '-wait-for-browser') headless_flags = '-headless' executable_name = utils.exe_suffix('firefox') From 8fab189d903f7cbcbfdb9e74b9327080e38be572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Sat, 25 Oct 2025 11:56:54 +0300 Subject: [PATCH 3/4] No macOS either --- test/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/common.py b/test/common.py index 62564f5aa2054..4959ad36d4f8e 100644 --- a/test/common.py +++ b/test/common.py @@ -30,7 +30,7 @@ from subprocess import PIPE, STDOUT from typing import Dict, Tuple from urllib.parse import parse_qs, unquote, unquote_plus, urlparse -from .utils import LINUX +from .utils import WINDOWS import clang_native import jsrun @@ -138,7 +138,7 @@ def configure(data_dir): class FirefoxConfig: data_dir_flag = '-profile ' - default_flags = ('-new-instance',) if LINUX else ('-new-instance', '-wait-for-browser') + default_flags = ('-new-instance', '-wait-for-browser') if WINDOWS else ('-new-instance',) headless_flags = '-headless' executable_name = utils.exe_suffix('firefox') From 65fa8c843d4bbe3c5e70b724e66a02647fb180fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Sat, 25 Oct 2025 11:57:59 +0300 Subject: [PATCH 4/4] Fix import --- test/common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/common.py b/test/common.py index 4959ad36d4f8e..a9878fdc79a79 100644 --- a/test/common.py +++ b/test/common.py @@ -30,7 +30,6 @@ from subprocess import PIPE, STDOUT from typing import Dict, Tuple from urllib.parse import parse_qs, unquote, unquote_plus, urlparse -from .utils import WINDOWS import clang_native import jsrun