summaryrefslogtreecommitdiff
path: root/gr-zeromq/python/zeromq/qa_zeromq_pub.py
diff options
context:
space:
mode:
authorBrennan Ashton <bashton@brennanashton.com>2018-11-03 00:56:56 -0700
committerBrennan Ashton <bashton@brennanashton.com>2018-11-03 01:53:57 -0700
commitfb78c4b0e60ce7a94bed3450d85e52d0fe96adff (patch)
tree89e61ccd1530ea5f226c757ecbf52a5074c91027 /gr-zeromq/python/zeromq/qa_zeromq_pub.py
parentabd594ae7df1dd15f9893e190846d789f752ab2d (diff)
gr-zeromq: Keep qa_zeromq_pub test from blocking
The core of this issue is the socket may not be ready when add_socket returns from probe_manager. Add a delay to give the socket time. Also make recv non-blocking, if the message is not recevied it will throw an exception. The thread was also calling poll with None. This is bad since if socket never gets the message the thread will wait forever. To help fail fast this patch also sets a time limit on the polling thread. This is referenced in #1261
Diffstat (limited to 'gr-zeromq/python/zeromq/qa_zeromq_pub.py')
-rw-r--r--gr-zeromq/python/zeromq/qa_zeromq_pub.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gr-zeromq/python/zeromq/qa_zeromq_pub.py b/gr-zeromq/python/zeromq/qa_zeromq_pub.py
index 2cee710d2a..01f32c5e7f 100644
--- a/gr-zeromq/python/zeromq/qa_zeromq_pub.py
+++ b/gr-zeromq/python/zeromq/qa_zeromq_pub.py
@@ -48,7 +48,9 @@ class qa_zeromq_pub (gr_unittest.TestCase):
zmq_pull_t.daemon = True
zmq_pull_t.start()
self.tb.run()
- zmq_pull_t.join()
+ zmq_pull_t.join(6.0)
+ # Check to see if we timed out
+ self.assertFalse(zmq_pull_t.is_alive())
self.assertFloatTuplesAlmostEqual(self.rx_data, src_data)
def recv_data (self, data):