diff options
author | Kevin Lund <kglund@google.com> | 2022-05-11 11:21:52 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-26 22:56:18 +0000 |
commit | 9eb70ed4ee956c5eabcb816b081b412b24bc88e3 (patch) | |
tree | 65325de017b92515ccffeeb491122d21a44b238e | |
parent | 4eb6e6fe9d4da125fb1774a2ded7f068828a8a2f (diff) | |
download | autotest-9eb70ed4ee956c5eabcb816b081b412b24bc88e3.tar.gz |
autotest: Correctly handle timeout in iperf warm up
The iperf_runner server setup runs an iperf command for 10 seconds to
ensure that the server has enough time to come online. The result of
this iperf command is supposed to be completely ignored, except for
some debug logging. However, when ignore_timeout is passed to the run()
function, SSH command timeouts result in None being returned from the
run() function.
(Source: http://cs/chromeos_public/src/platform/tauto/src/autotest_lib/server/hosts/ssh_host.py?l=272)
This means that when we check result.exit_status in the iperf server
setup, we get an exception if a timeout occurred. This change adds a
check to handle a None result value correctly, so we don't hit this
exception. The end result is that we should move on to the main perf
test, which has the logic to handle incorrect connectivity robustly.
BUG=b:214403123
TEST=Adjust timeout duration in the code to artificially trigger a
timeout every time we run the test. Without this CL, we hit the
"NoneType" failure case. With this CL, we correctly move on to the main
testing section, which handles the failure more robustly.
Change-Id: Ie10824d8d4b19d7174bf36dca996543f8e079493
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3642500
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Kevin Lund <kglund@google.com>
Tested-by: Kevin Lund <kglund@google.com>
Reviewed-by: Billy Zhao <billyzhao@chromium.org>
-rw-r--r-- | server/cros/network/iperf_runner.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/cros/network/iperf_runner.py b/server/cros/network/iperf_runner.py index 5f5a3ecdfc..6e1ed34416 100644 --- a/server/cros/network/iperf_runner.py +++ b/server/cros/network/iperf_runner.py @@ -385,7 +385,7 @@ class IperfRunner(object): ignore_status=True, ignore_timeout=True, timeout=self.IPERF_SERVER_MAX_STARTUP_WAIT_TIME) - if result.exit_status: + if not result or result.exit_status: logging.debug( 'Failed to make a connection to the server in %s seconds.', self.IPERF_SERVER_MAX_STARTUP_WAIT_TIME) |