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
packages=find_packages(),
author="Tommy Carpenter, E. Scott Daniels",
description="Python wrapper for RIC RMR",
packages=find_packages(),
author="Tommy Carpenter, E. Scott Daniels",
description="Python wrapper for RIC RMR",
def test_rcv_timeout():
"""
test torcv; this is a scary test because if it fails... it doesn't fail, it will run forever!
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.
"""
There is no unit test for rmr_rcv_msg; too dangerous, that is a blocking call that may never return.
"""
assert send_summary["message status"] == rcv_summary["message status"] == "RMR_OK"
# send an ACK back
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)
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)
sbuf_send = rmr.rmr_torcv_msg(MRC_SEND, sbuf_send, 2000)
send_ack_summary = rmr.message_summary(sbuf_send)
setenv =
LD_LIBRARY_PATH = /usr/local/lib/:/usr/local/lib64
RMR_SEED_RT = tests/fixtures/test_local.rt
setenv =
LD_LIBRARY_PATH = /usr/local/lib/:/usr/local/lib64
RMR_SEED_RT = tests/fixtures/test_local.rt
commands=pytest --verbose --cov {envsitepackagesdir}/rmr --cov-report term-missing --cov-report html
commands=pytest --verbose --cov {envsitepackagesdir}/rmr --cov-report term-missing --cov-report html