commit 2e66ab5e9ba19722090f298cc1c9c290c985e274
parent d5e3e7cab7cee84970878a7f131a9bd73f721b45
Author: serge-sans-paille <sguelton@mozilla.com>
Date: Sat, 29 Nov 2025 17:56:44 +0000
Bug 2002591 - Restore appropriate dynamic chunking behavior for gecko_taskgraph.util.chunking.chunk_manifests r=taskgraph-reviewers,ahal
Bug 1854964 fixed the logic but forgot to returned the actual result.
As a side effect, also improve the performance of the code snippet by
avoiding to compute useless auxiliary dict in the generic case (gains
~150ms on my setup).
Also remove the check for marionette, as those currently use .toml
files.
Differential Revision: https://phabricator.services.mozilla.com/D274151
Diffstat:
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/taskcluster/gecko_taskgraph/util/chunking.py b/taskcluster/gecko_taskgraph/util/chunking.py
@@ -175,24 +175,20 @@ def chunk_manifests(suite, platform, chunks, manifests):
A list of length `chunks` where each item contains a list of manifests
that run in that chunk.
"""
- ini_manifests = set([x.replace(".toml", ".ini") for x in manifests])
-
- if "web-platform-tests" not in suite and "marionette" not in suite:
+ if "web-platform-tests" not in suite:
+ ini_manifests = {x.replace(".toml", ".ini"): x for x in manifests}
runtimes = {
k: v for k, v in get_runtimes(platform, suite).items() if k in ini_manifests
}
- retVal = []
- for c in chunk_by_runtime(None, chunks, runtimes).get_chunked_manifests(
- ini_manifests
- ):
- retVal.append(
- [m if m in manifests else m.replace(".ini", ".toml") for m in c[1]]
- )
- # Keep track of test paths for each chunk, and the runtime information.
- chunked_manifests = [[] for _ in range(chunks)]
+ cbr = chunk_by_runtime(None, chunks, runtimes)
+ return [
+ [ini_manifests.get(m, m) for m in c]
+ for _, c in cbr.get_chunked_manifests(manifests)
+ ]
# Spread out the test manifests evenly across all chunks.
+ chunked_manifests = [[] for _ in range(chunks)]
for index, key in enumerate(sorted(manifests)):
chunked_manifests[index % chunks].append(key)