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:
Luca Boccassi 2020-06-27 18:26:09 +01:00
parent ff9efa106e
commit 5c5e279108

View File

@ -27,8 +27,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "testutil.hpp"
#include "testutil.hpp"
#include "testutil_unity.hpp"
@ -63,11 +61,12 @@ void setUp ()
zmq_setsockopt (rep[peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)));
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (rep[peer], my_endpoint));
}
// 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.
// 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);
}
}
void tearDown ()