Problem: test_pub_invert_matching failing

Solution: insert some sleeps to remedy timing dependencies
This commit is contained in:
Simon Giesecke
2018-05-22 10:45:05 +02:00
parent 12c6ae2283
commit f13377de05

View File

@@ -65,6 +65,7 @@ void test ()
// Send a message with the first prefix // Send a message with the first prefix
send_string_expect_success (pub, PREFIX1, 0); send_string_expect_success (pub, PREFIX1, 0);
msleep (SETTLE_TIME);
// sub1 should receive it, but not sub2 // sub1 should receive it, but not sub2
recv_string_expect_success (sub1, PREFIX1, ZMQ_DONTWAIT); recv_string_expect_success (sub1, PREFIX1, ZMQ_DONTWAIT);
@@ -73,6 +74,7 @@ void test ()
// Send a message with the second prefix // Send a message with the second prefix
send_string_expect_success (pub, PREFIX2, 0); send_string_expect_success (pub, PREFIX2, 0);
msleep (SETTLE_TIME);
// sub2 should receive it, but not sub1 // sub2 should receive it, but not sub1
recv_string_expect_success (sub2, PREFIX2, ZMQ_DONTWAIT); recv_string_expect_success (sub2, PREFIX2, ZMQ_DONTWAIT);
@@ -92,6 +94,7 @@ void test ()
// Send a message with the first prefix // Send a message with the first prefix
send_string_expect_success (pub, PREFIX1, 0); send_string_expect_success (pub, PREFIX1, 0);
msleep (SETTLE_TIME);
// sub2 should receive it, but not sub1 // sub2 should receive it, but not sub1
recv_string_expect_success (sub2, PREFIX1, ZMQ_DONTWAIT); recv_string_expect_success (sub2, PREFIX1, ZMQ_DONTWAIT);
@@ -100,6 +103,7 @@ void test ()
// Send a message with the second prefix // Send a message with the second prefix
send_string_expect_success (pub, PREFIX2, 0); send_string_expect_success (pub, PREFIX2, 0);
msleep (SETTLE_TIME);
// sub1 should receive it, but not sub2 // sub1 should receive it, but not sub2
recv_string_expect_success (sub1, PREFIX2, ZMQ_DONTWAIT); recv_string_expect_success (sub1, PREFIX2, ZMQ_DONTWAIT);