diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-21 19:14:48 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-21 21:27:13 -0700 |
| commit | 45692d50c33f1fbc45554a5b82281046c4b3621a (patch) | |
| tree | da0b6937e95b9b77ef8b809e0e65d86c9ef77fae /tests | |
| parent | e7b81a00dcf1184275aa2b2b40badba3dac990b7 (diff) | |
| download | nng-45692d50c33f1fbc45554a5b82281046c4b3621a.tar.gz nng-45692d50c33f1fbc45554a5b82281046c4b3621a.tar.bz2 nng-45692d50c33f1fbc45554a5b82281046c4b3621a.zip | |
fixes #472 Test for pub/sub fails due to not waiting long enough
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pubsub.c | 8 |
1 files 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); }); - }) |
