From 77f42ca53581089a15ede670f0be6b6203360491 Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Wed, 9 Jan 2019 20:30:16 +0300 Subject: 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 Signed-off-by: Ben Pfaff --- tests/test-ovsdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test-ovsdb.py') diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py index c03476c7f..2d1112ddd 100644 --- a/tests/test-ovsdb.py +++ b/tests/test-ovsdb.py @@ -604,7 +604,7 @@ def do_idl(schema_file, remote, *commands): stream = None for r in remotes: error, stream = ovs.stream.Stream.open_block( - ovs.stream.Stream.open(r)) + ovs.stream.Stream.open(r), 2000) if not error and stream: break stream = None -- cgit v1.2.1