Commit ada95e5e authored by Cosmin Ratiu's avatar Cosmin Ratiu Committed by Steffen Klassert
Browse files

tools/selftests: Use a sensible timeout value for iperf3 client



The default timeout of cmd() is 5 seconds and Iperf3Runner requests the
iperf3 client to run for 10 seconds, which clearly doesn't work since
commit [1] enforced the timeout parameter.

Use a value derived from duration as timeout (+5 seconds for
startup/teardown/various other overhead).

[1] commit f0bd1931 ("selftests: net: fix timeout passed as positional argument to communicate()")
Signed-off-by: default avatarCosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent ec54093e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -48,7 +48,10 @@ class Iperf3Runner:
        Starts the iperf3 client with the configured options.
        """
        cmdline = self._build_client(streams, duration, reverse)
        return cmd(cmdline, background=background, host=self.env.remote)
        kwargs = {"background": background, "host": self.env.remote}
        if not background:
            kwargs["timeout"] = duration + 5
        return cmd(cmdline, **kwargs)

    def measure_bandwidth(self, reverse=False):
        """