|
|
|
@ -11,11 +11,9 @@ import sys |
|
|
|
import time |
|
|
|
import time |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Эти тесты измеряют скорость/нагрузку CPU; autosocket проверяем отдельно с sudo. |
|
|
|
# Проверки точных порогов CPU/wall-time выполняем после общего пула. |
|
|
|
EXCLUSIVE = frozenset({ |
|
|
|
EXCLUSIVE = frozenset({ |
|
|
|
"bench_timeout_heap", "bench_uasync_timeouts", "test_u_async_performance", |
|
|
|
"test_media_async", "test_uasync_load", |
|
|
|
"test_intensive_memory_pool", "test_media_async", "test_bbr_integration", |
|
|
|
|
|
|
|
"test_uasync_load", "test_auto_socket_dynamic", |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
EXCLUSIVE |= {name + ".exe" for name in EXCLUSIVE} |
|
|
|
EXCLUSIVE |= {name + ".exe" for name in EXCLUSIVE} |
|
|
|
|
|
|
|
|
|
|
|
@ -95,6 +93,7 @@ def run_tests(args, requested_signals): |
|
|
|
failed = [] |
|
|
|
failed = [] |
|
|
|
running = [] |
|
|
|
running = [] |
|
|
|
index = 0 |
|
|
|
index = 0 |
|
|
|
|
|
|
|
tests = [name for name in args.tests if name not in EXCLUSIVE] + [name for name in args.tests if name in EXCLUSIVE] |
|
|
|
use_sudo = ("test_auto_socket_dynamic" in args.tests and hasattr(os, "geteuid") and os.geteuid() != 0 |
|
|
|
use_sudo = ("test_auto_socket_dynamic" in args.tests and hasattr(os, "geteuid") and os.geteuid() != 0 |
|
|
|
and shutil.which("sudo") and subprocess.run(["sudo", "-n", "true"], |
|
|
|
and shutil.which("sudo") and subprocess.run(["sudo", "-n", "true"], |
|
|
|
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0) |
|
|
|
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0) |
|
|
|
@ -108,13 +107,13 @@ def run_tests(args, requested_signals): |
|
|
|
|
|
|
|
|
|
|
|
print(f"[INFO] test runner: jobs={args.jobs} available_cpus={available_cpus()} timeout={args.timeout}s", flush=True) |
|
|
|
print(f"[INFO] test runner: jobs={args.jobs} available_cpus={available_cpus()} timeout={args.timeout}s", flush=True) |
|
|
|
try: |
|
|
|
try: |
|
|
|
while index < len(args.tests) or running: |
|
|
|
while index < len(tests) or running: |
|
|
|
if requested_signals: |
|
|
|
if requested_signals: |
|
|
|
raise InterruptedRun(requested_signals[0]) |
|
|
|
raise InterruptedRun(requested_signals[0]) |
|
|
|
while index < len(args.tests) and len(running) < args.jobs: |
|
|
|
while index < len(tests) and len(running) < args.jobs: |
|
|
|
if requested_signals: |
|
|
|
if requested_signals: |
|
|
|
break |
|
|
|
break |
|
|
|
name = args.tests[index] |
|
|
|
name = tests[index] |
|
|
|
if running and (name in EXCLUSIVE or running[0][0] in EXCLUSIVE): |
|
|
|
if running and (name in EXCLUSIVE or running[0][0] in EXCLUSIVE): |
|
|
|
break |
|
|
|
break |
|
|
|
index += 1 |
|
|
|
index += 1 |
|
|
|
@ -122,6 +121,8 @@ def run_tests(args, requested_signals): |
|
|
|
report(name, "SKIP", 0, "not built") |
|
|
|
report(name, "SKIP", 0, "not built") |
|
|
|
continue |
|
|
|
continue |
|
|
|
command = [str(Path(name).resolve())] |
|
|
|
command = [str(Path(name).resolve())] |
|
|
|
|
|
|
|
if name in EXCLUSIVE: |
|
|
|
|
|
|
|
print(f"[INFO] {name}: running alone to check CPU/wall-time limits", flush=True) |
|
|
|
if name == "test_auto_socket_dynamic" and use_sudo: |
|
|
|
if name == "test_auto_socket_dynamic" and use_sudo: |
|
|
|
command = ["sudo", "-n", "--"] + command |
|
|
|
command = ["sudo", "-n", "--"] + command |
|
|
|
print(f"[INFO] {name}: running as root via sudo -n", flush=True) |
|
|
|
print(f"[INFO] {name}: running as root via sudo -n", flush=True) |
|
|
|
|