From 3e23c796c9779de32d8d59ea34e81b3362eb9394 Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Mon, 27 Oct 2025 16:07:04 +0000 Subject: [PATCH] CI: ensure clean iperf3 server startup by killing existing processes on same port Before starting a new iperf3 server instance in CI tests, explicitly kill any existing iperf3 processes bound to the same port. This prevents conflicts or failures caused by leftover iperf3 servers from previous runs that did not terminate properly or on time. The cleanup is performed using `pkill` before launching the new server. --- ci-scripts/cls_oaicitest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 2b31f41064..144bc24da6 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -503,6 +503,11 @@ class OaiCiTest(): t = iperf_time * 2.5 cmd_ue.run(f'rm {client_filename}', reportNonZero=False, silent=True) if cn.runIperf3Server(): + # Clean up any existing iperf3 server processes on this port. + ret = cmd_svr.run(f"{cn.getCmdPrefix()} pkill -f '.*iperf3.*{port}'", reportNonZero=False) + # If pkill succeeds, it means there was a leftover iperf3 server. + if ret.returncode == 0: + logging.warning(f'Iperf3 server on port {port} detected and terminated') cmd_svr.run(f'{cn.getCmdPrefix()} timeout -vk3 {t} iperf3 -s -B {svrIP} -p {port} -1 {jsonReport} >> /dev/null &', timeout=t) cmd_ue.run(f'{ue.getCmdPrefix()} timeout -vk3 {t} {iperf_ue} -B {ueIP} -c {svrIP} -p {port} {iperf_opt} {jsonReport} {serverReport} -O 5 >> {client_filename}', timeout=t) dest_filename = archiveArtifact(cmd_ue, ctx, client_filename)