]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Execute long running system tests first
authorTom Krizek <tkrizek@isc.org>
Wed, 5 Apr 2023 10:39:56 +0000 (12:39 +0200)
committerTom Krizek <tkrizek@isc.org>
Mon, 22 May 2023 12:11:40 +0000 (14:11 +0200)
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.

bin/tests/system/conftest.py

index 340ec4728824922a1c94d1a769dcd829fc27885f..17693259d0fbf3bce332dbf5f7841b4ba3044dd1 100644 (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