mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-12 17:12:46 +00:00
Problem: test_req_relaxed occasionally fails
Solution: instead of relying on timing to get the order of connected rep sockets just right, wait for each connection
This commit is contained in:
parent
ff9efa106e
commit
5c5e279108
@ -27,8 +27,6 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "testutil.hpp"
|
|
||||||
|
|
||||||
#include "testutil.hpp"
|
#include "testutil.hpp"
|
||||||
#include "testutil_unity.hpp"
|
#include "testutil_unity.hpp"
|
||||||
|
|
||||||
@ -63,11 +61,12 @@ void setUp ()
|
|||||||
zmq_setsockopt (rep[peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)));
|
zmq_setsockopt (rep[peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)));
|
||||||
|
|
||||||
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (rep[peer], my_endpoint));
|
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (rep[peer], my_endpoint));
|
||||||
|
|
||||||
|
// These tests require strict ordering, so wait for the connections to
|
||||||
|
// happen before opening the next, so that messages flow in the
|
||||||
|
// expected direction
|
||||||
|
msleep (SETTLE_TIME);
|
||||||
}
|
}
|
||||||
// We have to give the connects time to finish otherwise the requests
|
|
||||||
// will not properly round-robin. We could alternatively connect the
|
|
||||||
// REQ sockets to the REP sockets.
|
|
||||||
msleep (SETTLE_TIME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tearDown ()
|
void tearDown ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user