aboutsummaryrefslogtreecommitdiff
path: root/tests/pubsub.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pubsub.c')
-rw-r--r--tests/pubsub.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/pubsub.c b/tests/pubsub.c
index de2fcfc5..3bdd8f8c 100644
--- a/tests/pubsub.c
+++ b/tests/pubsub.c
@@ -77,11 +77,12 @@ TestMain("PUB/SUB pattern", {
// and the sub dial. However, this creates a problem
// for our tests, since we can wind up trying to push
// data before the pipe is fully registered (the accept
- // runs asynchronously.) Doing the reverse here
- // ensures that we won't lose data.
+ // runs asynchronously.)
So(nng_listen(sub, addr, NULL, 0) == 0);
So(nng_dial(pub, addr, NULL, 0) == 0);
+ nng_usleep(20000); // give time for connecting threads
+
Convey("Sub can subscribe", {
So(nng_setopt(
sub, nng_optid_sub_subscribe, "ABC", 3) == 0);