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.
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 ---------------------------
# 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