Browse Source

tests: python: Speedup tests by reducing sleep time.

Also clean up the code.
doxygen_doc
Hartmut Goebel 6 months ago
parent
commit
da064cf420
1 changed files with 5 additions and 8 deletions
  1. +5
    -8
      test/python_tests/transport.py

+ 5
- 8
test/python_tests/transport.py View File

@ -15,7 +15,7 @@ import time
from glob import glob
timeout = 5
timeout = 500
def send_message(to, msg):
@ -53,17 +53,14 @@ def recv_message(inbox=None):
def wait_for_message():
"wait until a message arrives and return the message"
found = False
for i in range(timeout):
try:
msg = recv_message()
except IndexError:
time.sleep(1)
else:
found = True
break
if not found:
except IndexError:
time.sleep(0.01)
else:
# not found
raise RuntimeError("timeout")
return msg


Loading…
Cancel
Save