From 1c40864ff2856461e0108a415c0bebcd1095e1af Mon Sep 17 00:00:00 2001 From: Lukas Prause Date: Fri, 14 Oct 2022 12:46:12 +0200 Subject: [PATCH] Adds iperf timeout for bandwith measurements. --- measurement_main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/measurement_main.py b/measurement_main.py index fc95f25..f207c3a 100755 --- a/measurement_main.py +++ b/measurement_main.py @@ -25,6 +25,7 @@ NR_SERVINGCELL_COMMAND = b'AT+QENG="servingcell"\r\n' NR_EN_DC_STATUS_COMMAND = b"AT+QENDC\r\n" NR_SERIAL_RESPOND_TIME = 0.3 # s CMD_TIME_EPOCH = "date +%s" +TIMEOUT_OFFSET = 5.0 class ProcessHandler: @@ -369,7 +370,7 @@ class Server: self.config["port"], ) try: - subprocess.call(iperf_command, timeout=float(time) + 1) + subprocess.call(iperf_command, timeout=float(time) + 1 + TIMEOUT_OFFSET) except: print_message("iPerf timed out. Going ahead with next measurement...") processHandler.kill_all() @@ -441,7 +442,7 @@ class Server: "--one-off", ] try: - subprocess.call(iperf_command, timeout=float(time) + 1.0) + subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET) except: print_message("iPerf timed out. Going ahead with next measurement...") sleep(2) @@ -807,7 +808,7 @@ class Client: tcp_algo[congestion_control_index], ] try: - subprocess.call(iperf_command, timeout=float(time) + 2) + subprocess.call(iperf_command, timeout=float(time) + 2 + TIMEOUT_OFFSET) except: print_message("iPerf timed out. Going ahead with next measurement...") sleep(4) @@ -865,7 +866,7 @@ class Client: ) sleep(2) try: - subprocess.call(iperf_command, timeout=float(time)+2) + subprocess.call(iperf_command, timeout=float(time)+ 2 + TIMEOUT_OFFSET) except: print_message("iPerf timed out. Going ahead with next measurement...") processHandler.kill_all()