Correct unit test bug in rmr-python 51/1051/1
authorE. Scott Daniels <daniels@research.att.com>
Wed, 2 Oct 2019 12:28:58 +0000 (08:28 -0400)
committerE. Scott Daniels <daniels@research.att.com>
Wed, 2 Oct 2019 12:28:58 +0000 (08:28 -0400)
With RMR 1.8.x connections are forced to be asynch by default to
prevent kubernetes blocking the attempt for minutes. However, the
asynch nature of connections makes unit tests concerned with the
ability to send and receive messages non-deterministic as some
connections are established before the first message is sent, and
others are not.

This change ensures that unit tests establish connections in a
synchronous manner which ensures that the first send will not be
rejected by NNG due to a pending connection.

Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Change-Id: Ic72c48480d68e0aa8ba1bc0110b6222c3707ceaa

src/bindings/rmr-python/setup.py
src/bindings/rmr-python/tests/test_rmr.py
src/bindings/rmr-python/tox.ini

index 8679211..59368d4 100644 (file)
@@ -32,7 +32,7 @@ def _long_descr():
 
 setup(
     name="rmr",
-    version="0.13.0",
+    version="0.13.1",
     packages=find_packages(),
     author="Tommy Carpenter, E. Scott Daniels",
     description="Python wrapper for RIC RMR",
index 87b6c94..dfc1364 100644 (file)
@@ -150,7 +150,7 @@ def test_rmr_set_get():
 def test_rcv_timeout():
     """
     test torcv; this is a scary test because if it fails... it doesn't fail, it will run forever!
-    We recieve a message (though nothing has been sent) and make sure the function doesn't block forever.
+    We receive a message (though nothing has been sent) and make sure the function doesn't block forever.
 
     There is no unit test for rmr_rcv_msg; too dangerous, that is a blocking call that may never return.
     """
@@ -185,12 +185,12 @@ def test_send_rcv():
     assert send_summary["message status"] == rcv_summary["message status"] == "RMR_OK"
 
     # send an ACK back
-    ack_pay = b"message recieved"
+    ack_pay = b"message received"
     rmr.set_payload_and_length(ack_pay, sbuf_rcv)
     sbuf_rcv = rmr.rmr_rts_msg(MRC_RCV, sbuf_rcv)
     rcv_ack_summary = rmr.message_summary(sbuf_rcv)
 
-    # have the sender recieve it
+    # have the sender receive it
     sbuf_send = rmr.rmr_torcv_msg(MRC_SEND, sbuf_send, 2000)
     send_ack_summary = rmr.message_summary(sbuf_send)
 
index f67ca14..aeac89e 100644 (file)
@@ -25,6 +25,7 @@ deps=
 setenv =
     LD_LIBRARY_PATH = /usr/local/lib/:/usr/local/lib64
     RMR_SEED_RT = tests/fixtures/test_local.rt
+    RMR_ASYNC_CONN = 0
 
 
 commands=pytest --verbose --cov {envsitepackagesdir}/rmr  --cov-report term-missing --cov-report html