]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
oeqa ping.py: avoid busylooping failing ping command
authorMikko Rapeli <mikko.rapeli@linaro.org>
Wed, 5 Apr 2023 09:08:31 +0000 (12:08 +0300)
committerSteve Sakoman <steve@sakoman.com>
Mon, 24 Apr 2023 14:22:14 +0000 (04:22 -1000)
commit5e5975b199e161936471824aabc43da5097219fa
tree8f8f76cc94cee23df6c1d9e7a16451cbaa5250a5
parent0f8cd527966f22c3fa19d6efd7ff1524f3630976
oeqa ping.py: avoid busylooping failing ping command

Use a sleep on error path before trying again. For example
when oeqa runtime tests are executed without setting target
IP address correctly, the tests are drowning logs with messages:

2023-04-04 07:19:24,985 - runtime - INFO - test_ping (ping.PingTest.test_ping)
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
...
2023-04-04 07:19:55,002 - runtime - INFO -  ... FAIL
2023-04-04 07:19:55,002 - runtime - INFO - Traceback (most recent call
last):
  File \"/lava-62618/3/tests/3_oeqa-runtime-tests/image/lib/oeqa/runtime/cases/ping.py\", line 23, in test_ping
    output += proc.communicate()[0].decode('utf-8')
              ^^^^^^^^^^^^^^^^^^
  File \"/usr/lib/python3.11/subprocess.py\", line 1194, in communicate
    stdout = self.stdout.read()
             ^^^^^^^^^^^^^^^^^^
  File \"/lava-62618/3/tests/3_oeqa-runtime-tests/image/lib/oeqa/core/decorator/oetimeout.py\", line 18, in _timeoutHandler
    raise OEQATimeoutError(\"Timed out after %s \"
oeqa.core.exception.OEQATimeoutError: Timed out after 30 seconds of execution

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 87ec75710b5cd7b3f35d886003844d62d3182b54)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/lib/oeqa/runtime/cases/ping.py