2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Execute long running system tests first

In order to take the most advantage of parallel execution of tests,
ensure certain long running tests are scheduled first.

The list of tests considered long-running was created empirically. In
addition to the test run time, its position in the default
(alphabetical) ordering was also taken into account.
This commit is contained in:
Tom Krizek
2023-04-05 12:39:56 +02:00
parent 6f134283eb
commit 99e2e50c0e

View File

@@ -94,6 +94,16 @@ else:
PORT_MIN = 5001
PORT_MAX = 32767
PORTS_PER_TEST = 20
PRIORITY_TESTS = [
# Tests that are scheduled first. Speeds up parallel execution.
"dupsigs/",
"rpz/",
"rpzrecurse/",
"serve-stale/",
"timeouts/",
"upforwd/",
]
PRIORITY_TESTS_RE = re.compile("|".join(PRIORITY_TESTS))
# ---------------------- Module initialization ---------------------------
@@ -200,6 +210,17 @@ else:
# from previous runs could mess with the runner.
return "_tmp_" in str(path)
def pytest_collection_modifyitems(items):
"""Schedule long-running tests first to get more benefit from parallelism."""
priority = []
other = []
for item in items:
if PRIORITY_TESTS_RE.search(item.nodeid):
priority.append(item)
else:
other.append(item)
items[:] = priority + other
class NodeResult:
def __init__(self, report=None):
self.outcome = None