From 45692d50c33f1fbc45554a5b82281046c4b3621a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 21 May 2018 19:14:48 -0700 Subject: fixes #472 Test for pub/sub fails due to not waiting long enough --- tests/pubsub.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/pubsub.c b/tests/pubsub.c index 2151611d..d12a2df3 100644 --- a/tests/pubsub.c +++ b/tests/pubsub.c @@ -102,7 +102,7 @@ TestMain("PUB/SUB pattern", { So(nng_listen(sub, addr, NULL, 0) == 0); So(nng_dial(pub, addr, NULL, 0) == 0); - nng_msleep(20); // give time for connecting threads + nng_msleep(200); // give time for connecting threads Convey("Subs can receive from pubs", { nng_msg *msg; @@ -136,7 +136,6 @@ TestMain("PUB/SUB pattern", { }); Convey("Subs without subsciptions don't receive", { - nng_msg *msg; So(nng_setopt_ms(sub, NNG_OPT_RECVTIMEO, 90) == 0); @@ -145,11 +144,9 @@ TestMain("PUB/SUB pattern", { So(nng_sendmsg(pub, msg, 0) == 0); So(nng_recvmsg(sub, &msg, 0) == NNG_ETIMEDOUT); }); - }); Convey("Subs in raw receive", { - nng_msg * msg; nng_socket pub; nng_socket sub; @@ -172,7 +169,7 @@ TestMain("PUB/SUB pattern", { So(nng_listen(sub, addr, NULL, 0) == 0); So(nng_dial(pub, addr, NULL, 0) == 0); - nng_msleep(20); // give time for connecting threads + nng_msleep(200); // give time for connecting threads So(nng_setopt_ms(sub, NNG_OPT_RECVTIMEO, 90) == 0); So(nng_getopt_bool(sub, NNG_OPT_RAW, &raw) == 0); @@ -185,5 +182,4 @@ TestMain("PUB/SUB pattern", { CHECKSTR(msg, "/some/like/it/raw"); nng_msg_free(msg); }); - }) -- cgit v1.2.3-70-g09d2