problem: test_xpub_nodrop fails frequently

Solution: fix the test
This commit is contained in:
somdoron 2019-10-07 09:35:59 +03:00
parent 539718f35a
commit 2d6a66a81d

View File

@ -101,8 +101,15 @@ void test ()
send_count++;
TEST_ASSERT_EQUAL_INT (EAGAIN, errno);
while (zmq_recv (sub, NULL, 0, ZMQ_DONTWAIT) == 0)
if (send_count > 0) {
// Receive first message with blocking
TEST_ASSERT_SUCCESS_ERRNO (zmq_recv (sub, NULL, 0, 0));
recv_count++;
while (zmq_recv (sub, NULL, 0, ZMQ_DONTWAIT) == 0)
recv_count++;
}
TEST_ASSERT_EQUAL_INT (send_count, recv_count);
// Clean up.