Commit a7a512ab authored by Pieter Hintjens's avatar Pieter Hintjens

Problem: test cases are failing on slower PCs (eee PC)

Solution: raise timeouts from 100-150 msec to 250 msec
parent 9fc0d2f1
...@@ -75,7 +75,7 @@ int main (void) ...@@ -75,7 +75,7 @@ int main (void)
// We now consume from the connected pipe // We now consume from the connected pipe
// - we should see just 5 // - we should see just 5
int timeout = 100; int timeout = 250;
rc = zmq_setsockopt (to, ZMQ_RCVTIMEO, &timeout, sizeof (int)); rc = zmq_setsockopt (to, ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
......
...@@ -37,7 +37,7 @@ static void bounce_fail (void *server, void *client) ...@@ -37,7 +37,7 @@ static void bounce_fail (void *server, void *client)
assert (rc == 32); assert (rc == 32);
// Receive message at server side (should not succeed) // Receive message at server side (should not succeed)
int timeout = 150; int timeout = 250;
rc = zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (int)); rc = zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
rc = zmq_recv (server, buffer, 32, 0); rc = zmq_recv (server, buffer, 32, 0);
...@@ -77,7 +77,7 @@ static void run_test (int opt, T optval, int expected_error, int bounce_test) ...@@ -77,7 +77,7 @@ static void run_test (int opt, T optval, int expected_error, int bounce_test)
assert (sc); assert (sc);
// If a test fails, don't hang for too long // If a test fails, don't hang for too long
int timeout = 1500; int timeout = 2500;
rc = zmq_setsockopt (sb, ZMQ_RCVTIMEO, &timeout, sizeof (int)); rc = zmq_setsockopt (sb, ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
rc = zmq_setsockopt (sb, ZMQ_SNDTIMEO, &timeout, sizeof (int)); rc = zmq_setsockopt (sb, ZMQ_SNDTIMEO, &timeout, sizeof (int));
......
...@@ -66,7 +66,7 @@ int main (void) ...@@ -66,7 +66,7 @@ int main (void)
// We now consume from the connected pipe // We now consume from the connected pipe
// - we should see just 5 // - we should see just 5
int timeout = 100; int timeout = 250;
rc = zmq_setsockopt (to, ZMQ_RCVTIMEO, &timeout, sizeof (int)); rc = zmq_setsockopt (to, ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
......
...@@ -44,7 +44,7 @@ int main (void) ...@@ -44,7 +44,7 @@ int main (void)
rep [peer] = zmq_socket (ctx, ZMQ_REP); rep [peer] = zmq_socket (ctx, ZMQ_REP);
assert (rep [peer]); assert (rep [peer]);
int timeout = 100; int timeout = 250;
rc = zmq_setsockopt (rep [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); rc = zmq_setsockopt (rep [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
......
...@@ -244,7 +244,7 @@ int main (void) ...@@ -244,7 +244,7 @@ int main (void)
send (s, "\x01\x00", 2, 0); send (s, "\x01\x00", 2, 0);
// send sneaky message that shouldn't be received // send sneaky message that shouldn't be received
send (s, "\x08\x00sneaky\0", 9, 0); send (s, "\x08\x00sneaky\0", 9, 0);
int timeout = 150; int timeout = 250;
zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (timeout)); zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (timeout));
char *buf = s_recv (server); char *buf = s_recv (server);
if (buf != NULL) { if (buf != NULL) {
......
...@@ -157,7 +157,7 @@ int main (void) ...@@ -157,7 +157,7 @@ int main (void)
send (s, "\x01\x00", 2, 0); send (s, "\x01\x00", 2, 0);
// send sneaky message that shouldn't be received // send sneaky message that shouldn't be received
send (s, "\x08\x00sneaky\0", 9, 0); send (s, "\x08\x00sneaky\0", 9, 0);
int timeout = 150; int timeout = 250;
zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (timeout)); zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (timeout));
char *buf = s_recv (server); char *buf = s_recv (server);
if (buf != NULL) { if (buf != NULL) {
......
...@@ -163,7 +163,7 @@ int main (void) ...@@ -163,7 +163,7 @@ int main (void)
send (s, "\x01\x00", 2, 0); send (s, "\x01\x00", 2, 0);
// send sneaky message that shouldn't be received // send sneaky message that shouldn't be received
send (s, "\x08\x00sneaky\0", 9, 0); send (s, "\x08\x00sneaky\0", 9, 0);
int timeout = 150; int timeout = 250;
zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (timeout)); zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (timeout));
char *buf = s_recv (server); char *buf = s_recv (server);
if (buf != NULL) { if (buf != NULL) {
......
...@@ -36,7 +36,7 @@ void test_round_robin_out (void *ctx) ...@@ -36,7 +36,7 @@ void test_round_robin_out (void *ctx)
rep [peer] = zmq_socket (ctx, ZMQ_REP); rep [peer] = zmq_socket (ctx, ZMQ_REP);
assert (rep [peer]); assert (rep [peer]);
int timeout = 100; int timeout = 250;
rc = zmq_setsockopt (rep [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); rc = zmq_setsockopt (rep [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
...@@ -77,7 +77,7 @@ void test_fair_queue_in (void *ctx) ...@@ -77,7 +77,7 @@ void test_fair_queue_in (void *ctx)
void *receiver = zmq_socket (ctx, ZMQ_DEALER); void *receiver = zmq_socket (ctx, ZMQ_DEALER);
assert (receiver); assert (receiver);
int timeout = 100; int timeout = 250;
int rc = zmq_setsockopt (receiver, ZMQ_RCVTIMEO, &timeout, sizeof (int)); int rc = zmq_setsockopt (receiver, ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
...@@ -200,7 +200,7 @@ void test_block_on_send_no_peers (void *ctx) ...@@ -200,7 +200,7 @@ void test_block_on_send_no_peers (void *ctx)
void *sc = zmq_socket (ctx, ZMQ_DEALER); void *sc = zmq_socket (ctx, ZMQ_DEALER);
assert (sc); assert (sc);
int timeout = 100; int timeout = 250;
int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout)); int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout));
assert (rc == 0); assert (rc == 0);
......
...@@ -36,7 +36,7 @@ void test_push_round_robin_out (void *ctx) ...@@ -36,7 +36,7 @@ void test_push_round_robin_out (void *ctx)
pulls [peer] = zmq_socket (ctx, ZMQ_PULL); pulls [peer] = zmq_socket (ctx, ZMQ_PULL);
assert (pulls [peer]); assert (pulls [peer]);
int timeout = 100; int timeout = 250;
rc = zmq_setsockopt (pulls [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); rc = zmq_setsockopt (pulls [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
...@@ -155,7 +155,7 @@ void test_push_block_on_send_no_peers (void *ctx) ...@@ -155,7 +155,7 @@ void test_push_block_on_send_no_peers (void *ctx)
void *sc = zmq_socket (ctx, ZMQ_PUSH); void *sc = zmq_socket (ctx, ZMQ_PUSH);
assert (sc); assert (sc);
int timeout = 100; int timeout = 250;
int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout)); int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout));
assert (rc == 0); assert (rc == 0);
......
...@@ -27,7 +27,7 @@ void test_fair_queue_in (void *ctx) ...@@ -27,7 +27,7 @@ void test_fair_queue_in (void *ctx)
void *rep = zmq_socket (ctx, ZMQ_REP); void *rep = zmq_socket (ctx, ZMQ_REP);
assert (rep); assert (rep);
int timeout = 100; int timeout = 250;
int rc = zmq_setsockopt (rep, ZMQ_RCVTIMEO, &timeout, sizeof (int)); int rc = zmq_setsockopt (rep, ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
......
...@@ -36,7 +36,7 @@ void test_round_robin_out (void *ctx) ...@@ -36,7 +36,7 @@ void test_round_robin_out (void *ctx)
rep [peer] = zmq_socket (ctx, ZMQ_REP); rep [peer] = zmq_socket (ctx, ZMQ_REP);
assert (rep [peer]); assert (rep [peer]);
int timeout = 100; int timeout = 250;
rc = zmq_setsockopt (rep [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); rc = zmq_setsockopt (rep [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
...@@ -83,7 +83,7 @@ void test_req_only_listens_to_current_peer (void *ctx) ...@@ -83,7 +83,7 @@ void test_req_only_listens_to_current_peer (void *ctx)
router [i] = zmq_socket (ctx, ZMQ_ROUTER); router [i] = zmq_socket (ctx, ZMQ_ROUTER);
assert (router [i]); assert (router [i]);
int timeout = 100; int timeout = 250;
rc = zmq_setsockopt (router [i], ZMQ_RCVTIMEO, &timeout, sizeof (timeout)); rc = zmq_setsockopt (router [i], ZMQ_RCVTIMEO, &timeout, sizeof (timeout));
assert (rc == 0); assert (rc == 0);
...@@ -195,7 +195,7 @@ void test_block_on_send_no_peers (void *ctx) ...@@ -195,7 +195,7 @@ void test_block_on_send_no_peers (void *ctx)
void *sc = zmq_socket (ctx, ZMQ_REQ); void *sc = zmq_socket (ctx, ZMQ_REQ);
assert (sc); assert (sc);
int timeout = 100; int timeout = 250;
int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout)); int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout));
assert (rc == 0); assert (rc == 0);
......
...@@ -27,7 +27,7 @@ void test_fair_queue_in (void *ctx) ...@@ -27,7 +27,7 @@ void test_fair_queue_in (void *ctx)
void *receiver = zmq_socket (ctx, ZMQ_ROUTER); void *receiver = zmq_socket (ctx, ZMQ_ROUTER);
assert (receiver); assert (receiver);
int timeout = 100; int timeout = 250;
int rc = zmq_setsockopt (receiver, ZMQ_RCVTIMEO, &timeout, sizeof (int)); int rc = zmq_setsockopt (receiver, ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0); assert (rc == 0);
......
...@@ -112,7 +112,7 @@ expect_bounce_fail (void *server, void *client) ...@@ -112,7 +112,7 @@ expect_bounce_fail (void *server, void *client)
{ {
const char *content = "12345678ABCDEFGH12345678abcdefgh"; const char *content = "12345678ABCDEFGH12345678abcdefgh";
char buffer [32]; char buffer [32];
int timeout = 150; int timeout = 250;
// Send message from client to server // Send message from client to server
int rc = zmq_setsockopt (client, ZMQ_SNDTIMEO, &timeout, sizeof (int)); int rc = zmq_setsockopt (client, ZMQ_SNDTIMEO, &timeout, sizeof (int));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment