commit e0622dafb37d86517fa6100db9cfb7fffa303903
parent 6c2362da93eca9a347b03737e5a463ad2ecc8053
Author: Florian Quèze <florian@queze.net>
Date: Wed, 22 Oct 2025 19:09:24 +0000
Bug 1995627 - optimize xpcshell test parallel execution by avoiding long-running tests at the end, r=jmaher.
Differential Revision: https://phabricator.services.mozilla.com/D269624
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/testing/xpcshell/runxpcshelltests.py b/testing/xpcshell/runxpcshelltests.py
@@ -2282,6 +2282,17 @@ class XPCShellTests:
else:
tests_queue.append(test)
+ # Sort parallel tests by timeout factor (descending) to start slower tests first
+ # This helps optimize parallel execution by avoiding long-running tests at the end
+ if tests_queue:
+ tests_queue = deque(
+ sorted(
+ tests_queue,
+ key=lambda t: int(t.test_object.get("requesttimeoutfactor", 1)),
+ reverse=True,
+ )
+ )
+
status = self.runTestList(
tests_queue, sequential_tests, testClass, mobileArgs, **kwargs
)