Skip to content

Commit 0af8926

Browse files
Exclude network resource for {stan, pablogsal}-raspbian (#641)
1 parent 860c070 commit 0af8926

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

master/custom/factories.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
7777
# Adjust the timeout for this worker
7878
self.test_timeout *= kwargs.get("timeout_factor", 1)
7979

80+
exclude_test_resources = kwargs.get("exclude_test_resources", [])
81+
8082
# In 3.10, test_asyncio wasn't split out, and refleaks tests
8183
# need more time.
8284
if branch == "3.10" and has_option("-R", self.testFlags):
@@ -112,6 +114,19 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
112114
testopts.append(parallel)
113115
if not has_option("-j", testopts):
114116
testopts.append("-j2")
117+
# Add excluded test resources
118+
if exclude_test_resources:
119+
u_loc = None
120+
for i, opt in enumerate(testopts):
121+
if opt.startswith("-u"):
122+
u_loc = i
123+
break
124+
if u_loc is not None:
125+
for resource in exclude_test_resources:
126+
testopts[u_loc] += f",-{resource}"
127+
else:
128+
testopts.append(f"-uall,{",".join(f"-{r}" for r in exclude_test_resources)}")
129+
115130
test = [
116131
"make",
117132
"buildbottest",

master/custom/workers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ def __init__(
3030
not_branches=None,
3131
parallel_builders=None,
3232
parallel_tests=None,
33+
exclude_test_resources=None,
3334
):
3435
self.name = name
3536
self.tags = tags or set()
3637
self.branches = branches
3738
self.not_branches = not_branches
3839
self.parallel_builders = parallel_builders
3940
self.parallel_tests = parallel_tests
41+
self.exclude_test_resources = exclude_test_resources
4042
worker_settings = settings.workers[name]
4143
owner = name.split("-")[0]
4244
owner_settings = settings.owners[owner]
@@ -193,7 +195,9 @@ def get_workers(settings):
193195
'aarch64', 'arm'],
194196
parallel_tests=4,
195197
# Tests fail with latin1 encoding on 3.12, probably earlier
196-
not_branches=['3.12', '3.11', '3.10']
198+
not_branches=['3.12', '3.11', '3.10'],
199+
# Problematic ISP causes issues connecting to testpython.net
200+
exclude_test_resources=['network'],
197201
),
198202
cpw(
199203
name="savannah-raspbian",
@@ -219,6 +223,8 @@ def get_workers(settings):
219223
name="pablogsal-rasp",
220224
tags=['linux', 'unix', 'raspbian', 'debian', 'arm'],
221225
parallel_tests=2,
226+
# Problematic ISP causes issues connecting to testpython.net
227+
exclude_test_resources=['network'],
222228
),
223229
cpw(
224230
name="skumaran-ubuntu-x86_64",

master/master.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ extra_factory_args = {
165165

166166
}
167167

168+
# Build factory args from worker properties
169+
for w in WORKERS:
170+
if w.exclude_test_resources:
171+
if w.name not in extra_factory_args:
172+
extra_factory_args[w.name] = {}
173+
extra_factory_args[w.name]["exclude_test_resources"] = w.exclude_test_resources
174+
168175
# The following with the worker owners' agreement
169176
cpulock = locks.WorkerLock(
170177
"cpu",

0 commit comments

Comments
 (0)