Skip to content

Commit 00f12d2

Browse files
Thomas-Barbier-1Abluca
authored andcommitted
test_mock_pub_sub: increase wait time in mock pub/sub test for loaded systems
The msleep(1) in test_mock_pub_sub() can cause random failures onmachines under heavy load. As this test seems to validates compatibility between different ZMTP version and not performance, I propose Increase the wait time to allow the state machine to properly attach the pipe after handshake. Note to simulate the overloaded machine in local I used: stress-ng --cpu 24 --switch 16 --timer 8 --timeout 60s & while tests/test_mock_pub_sub do echo "PASS" done
1 parent 900a548 commit 00f12d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_mock_pub_sub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static void test_mock_pub_sub (bool sub_command_, bool mock_pub_)
141141
TEST_ASSERT_EQUAL_INT (0, rc);
142142
// SUB binds, let its state machine run
143143
// Because zeromq attach the pipe after the handshake, we need more time here before we can run the state-machine
144-
msleep (1);
144+
msleep (10);
145145
zmq_recv (server, buffer, 16, ZMQ_DONTWAIT);
146146

147147
if (sub_command_) {

0 commit comments

Comments
 (0)