0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-14 01:37:56 +08:00

Problem: race condition in test_hwm

Solution: wait a bit to allow connect to succeed if inproc bind preceded connect
This commit is contained in:
Simon Giesecke 2019-03-01 16:57:29 -05:00
parent 14fd7505bc
commit 73159a8fab

View File

@ -99,6 +99,10 @@ int count_msg (int send_hwm_, int recv_hwm_, TestType test_type_)
TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (
connect_socket, ZMQ_SNDHWM, &send_hwm_, sizeof (send_hwm_)));
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (connect_socket, "inproc://a"));
// we must wait for the connect to succeed here, unfortunately we don't
// have monitoring events for inproc, so we just hope SETTLE_TIME suffices
msleep (SETTLE_TIME);
} else {
// Set up connect socket
connect_socket = test_context_socket (ZMQ_PUSH);