From ec7064e40b2d066dda536d7d2772374c5aa008ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 31 Oct 2026 09:17:04 +0100 Subject: [PATCH] test.py: Run the relay ad hoc tests at 800% Every hop through the relay waits a millisecond or so of real time, which the speed multiplies: at 1600% on macOS CI a relay PTP receive in pair/ptppoll timed out. Relay mode hardly gains above 800% anyway (26 s against 22 s locally); P2P stays at 1600%. Co-Authored-By: Claude Opus 5.5 --- test.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test.py b/test.py index d7a8fe8223..a68390f02f 100755 --- a/test.py +++ b/test.py @@ -797,11 +797,13 @@ test_flags = { # The ad hoc tests create groups, so they need a server to log in to, and they wait for its replies # in real time. -# They run at 16x PSP speed: timeouts and delays are in emulated time, and only the local network round -# trips stay real. The instances of a pair test keep in step in emulated time (Tools/adhoc_multi.py), so -# one a busy machine runs slower holds the other back instead of falling behind it. -ADHOC_SPEED = os.environ.get("ADHOC_SPEED", "1600") -ADHOC_FLAGS = ["--adhoc-server", "--realtime", "--speed=" + ADHOC_SPEED, "--timeout-wall=60"] +# They run faster than PSP speed: timeouts and delays are in emulated time, and only the local network +# round trips stay real. The instances of a pair test keep in step in emulated time (Tools/adhoc_multi.py), +# so one a busy machine runs slower holds the other back instead of falling behind it. Every hop through +# the relay waits a millisecond or so of real time, which the speed multiplies, so relay mode runs slower +# (it hardly gains above 8x anyway). ADHOC_SPEED overrides both. +ADHOC_SPEEDS = {"relay": os.environ.get("ADHOC_SPEED", "800"), "p2p": os.environ.get("ADHOC_SPEED", "1600")} +ADHOC_FLAGS = ["--adhoc-server", "--realtime", "--timeout-wall=60"] def flags_for(test): if test in test_flags: @@ -944,7 +946,7 @@ def run_pair_tests(test_list, args, modes): if mode == "relay": cmdline.append('--relay') cmdline.extend([i for i in args if i not in ['-g', '-m', '-b', '--teamcity']]) - cmdline.append("--speed=" + ADHOC_SPEED) + cmdline.append("--speed=" + ADHOC_SPEEDS[mode]) cmdline.extend(tests) returncode = subprocess.call(cmdline) or returncode print("Ran " + ' '.join(cmdline)) @@ -1029,7 +1031,7 @@ def main(): print("Skipping known failure in %s mode: %s" % (mode, test), flush=True) continue print("%s mode:" % mode, flush=True) - mode_flags = ["--appendconfig=" + relay_ini_path()] if mode == "relay" else [] + mode_flags = ["--speed=" + ADHOC_SPEEDS[mode]] + (["--appendconfig=" + relay_ini_path()] if mode == "relay" else []) returncode = run_tests([test], args + flags_for(test) + mode_flags) or returncode if pair: returncode = run_pair_tests(pair, args, adhoc_modes) or returncode