From c9db3194df3c370dc0cbbd91bd3bc6eea3197f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Sch=C3=BCtt?= Date: Fri, 6 Jun 2025 11:20:43 +0200 Subject: [PATCH] Tests: Take timing variance into account when flagging slow tests --- tests/do_regtest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/do_regtest.py b/tests/do_regtest.py index 6280b269c0..41c29f0381 100755 --- a/tests/do_regtest.py +++ b/tests/do_regtest.py @@ -213,7 +213,7 @@ async def main() -> None: for t in await asyncio.gather(*rerun_tasks): rerun_times.update({r.fullname: r.duration for r in t.results}) stats = {r.fullname: [r.duration, rerun_times[r.fullname]] for r in maybe_slow} - slow_tests = {k: v for k, v in stats.items() if mean(v) > threshold} + slow_tests = {k: v for k, v in stats.items() if mean(v) - stdev(v) > threshold} print(f"Duration threshold (2x 95th %ile): {threshold:.2f} sec") print(f"Found {len(slow_tests)} slow tests ({num_suppressed} suppressed):") for k, v in slow_tests.items():