mirror of
git://git.yoctoproject.org/poky
synced 2026-04-02 02:49:11 +00:00
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
(From OE-Core rev: 5e5975b199e161936471824aabc43da5097219fa)
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>
This commit is contained in:
parent
3eaa4cef1f
commit
99213e4254
@ -5,6 +5,7 @@
|
||||
#
|
||||
|
||||
from subprocess import Popen, PIPE
|
||||
from time import sleep
|
||||
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
from oeqa.core.decorator.oetimeout import OETimeout
|
||||
@ -25,6 +26,7 @@ class PingTest(OERuntimeTestCase):
|
||||
count += 1
|
||||
else:
|
||||
count = 0
|
||||
sleep(1)
|
||||
except OEQATimeoutError:
|
||||
self.fail("Ping timeout error for address %s, count %s, output: %s" % (self.target.ip, count, output))
|
||||
msg = ('Expected 5 consecutive, got %d.\n'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user