Skip to content

Commit b46df16

Browse files
encukouzware
andauthored
Migrate extra_factory_args to worker configuration (GH-694)
Co-authored-by: Zachary Ware <zach@python.org>
1 parent ac55571 commit b46df16

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

master/custom/workers.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def __init__(
3030
not_branches=None,
3131
parallel_builders=None,
3232
parallel_tests=None,
33+
timeout_factor=None,
3334
exclude_test_resources=None,
3435
):
3536
self.name = name
@@ -38,7 +39,15 @@ def __init__(
3839
self.not_branches = not_branches
3940
self.parallel_builders = parallel_builders
4041
self.parallel_tests = parallel_tests
41-
self.exclude_test_resources = exclude_test_resources
42+
43+
# Forward some args to build factories
44+
_xf_args = {}
45+
self.extra_factory_args = _xf_args
46+
if timeout_factor is not None:
47+
_xf_args['timeout_factor'] = timeout_factor
48+
if exclude_test_resources is not None:
49+
_xf_args['exclude_test_resources'] = exclude_test_resources
50+
4251
worker_settings = settings.workers[name]
4352
owner = name.split("-")[0]
4453
owner_settings = settings.owners[owner]
@@ -124,6 +133,7 @@ def get_workers(settings):
124133
tags=['linux', 'unix', 'rhel', 'ppc64le'],
125134
parallel_tests=10,
126135
branches=['3.10', '3.11', '3.12'],
136+
timeout_factor=2, # Increase the timeout on this slow worker
127137
),
128138
cpw(
129139
name="cstratak-CentOS9-ppc64le",
@@ -283,6 +293,7 @@ def get_workers(settings):
283293
not_branches=['3.10'],
284294
parallel_tests=2,
285295
parallel_builders=2,
296+
timeout_factor=2, # Increase the timeout on this slow worker
286297
),
287298
cpw(
288299
name="ambv-bb-win11",

master/master.cfg

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -154,24 +154,6 @@ c["builders"] = []
154154
c["schedulers"] = []
155155

156156
parallel = {w.name: f"-j{w.parallel_tests}" for w in WORKERS if w.parallel_tests}
157-
extra_factory_args = {
158-
"cstratak-RHEL8-ppc64le": {
159-
# Increase the timeout on this slow worker
160-
"timeout_factor": 2,
161-
},
162-
"bcannon-wasi": {
163-
# Increase the timeout on this slow worker
164-
"timeout_factor": 2,
165-
},
166-
167-
}
168-
169-
# Build factory args from worker properties
170-
for w in WORKERS:
171-
if w.exclude_test_resources:
172-
if w.name not in extra_factory_args:
173-
extra_factory_args[w.name] = {}
174-
extra_factory_args[w.name]["exclude_test_resources"] = w.exclude_test_resources
175157

176158
# The following with the worker owners' agreement
177159
cpulock = locks.WorkerLock(
@@ -288,7 +270,7 @@ for branch_num, (git_url, branchname, git_branch) in enumerate(git_branches):
288270
source,
289271
parallel=parallel.get(worker_name),
290272
branch=branchname,
291-
**extra_factory_args.get(worker_name, {}),
273+
**worker.extra_factory_args,
292274
)
293275
tags = [branchname, stability, *getattr(f, "tags", [])]
294276
if tier:
@@ -389,14 +371,16 @@ for name, worker_name, buildfactory, stability, tier in BUILDERS:
389371

390372
source = GitHub(repourl=git_url, **GIT_KWDS)
391373

374+
worker = WORKERS_BY_NAME[worker_name]
375+
392376
f = buildfactory(
393377
source,
394378
parallel=parallel.get(worker_name),
395379
# Use the same downstream branch names as the "custom"
396380
# builder (check what the factories are doing with this
397381
# parameter for more info).
398382
branch="3",
399-
**extra_factory_args.get(worker_name, {}),
383+
**worker.extra_factory_args,
400384
)
401385

402386
tags = ["PullRequest", stability, *getattr(f, "tags", [])]

0 commit comments

Comments
 (0)