summaryrefslogtreecommitdiff
path: root/tests/test-stream.py
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@samsung.com>2019-01-09 20:30:16 +0300
committerBen Pfaff <blp@ovn.org>2019-01-10 15:39:48 -0800
commit77f42ca53581089a15ede670f0be6b6203360491 (patch)
treeddba6bb6ed2f52751d44e021c6e552dbfee6bf75 /tests/test-stream.py
parent747652d23e4261f5e526851c958dbec9c8f19a7e (diff)
downloadopenvswitch-77f42ca53581089a15ede670f0be6b6203360491.tar.gz
stream: Allow timeout configuration for open_block.
On some systems in case where remote is not responding, socket could remain in SYN_SENT state for a really long time without errors waiting for connection. This leads to situations where open_blok() hangs for a few minutes waiting for connection to the DOWN remote. For example, our "multiple remotes" idl tests hangs waiting for connection to the WRONG_PORT on FreeBSD in CirrusCI environment. This leads to test failures because Alarm signal arrives much faster than ETIMEDOUT from the socket. This patch allowes to specify timeout value for 'open_block' function. If the connection takes more time, socket will be closed with ETIMEDOUT error code. Negative value or None in python could be used to wait infinitely. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'tests/test-stream.py')
-rw-r--r--tests/test-stream.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test-stream.py b/tests/test-stream.py
index 4a5117501..93d63c019 100644
--- a/tests/test-stream.py
+++ b/tests/test-stream.py
@@ -20,7 +20,7 @@ import ovs.stream
def main(argv):
remote = argv[1]
err, stream = ovs.stream.Stream.open_block(
- ovs.stream.Stream.open(remote))
+ ovs.stream.Stream.open(remote), 10000)
if err or stream is None:
sys.exit(1)