Adds iperf timeout for bandwith measurements.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user