From: Tom Krizek Date: Wed, 5 Apr 2023 10:39:56 +0000 (+0200) Subject: Execute long running system tests first X-Git-Tag: v9.19.14~35^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99e2e50c0eddf2c16f9a684f4b90db0918a20b07;p=thirdparty%2Fbind9.git 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. --- diff --git a/bin/tests/system/conftest.py b/bin/tests/system/conftest.py index 340ec472882..17693259d0f 100644 --- a/bin/tests/system/conftest.py +++ b/bin/tests/system/conftest.py @@ -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