aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-04-14 14:29:57 -0700
committerGarrett D'Amore <garrett@damore.org>2017-04-14 14:29:57 -0700
commitf31d818c02c95484b7a9c5f8667559bd2524b071 (patch)
tree501bf4d7c6f08af8ebd519d848a2f2b624f8a3e9 /tests
parent349c1c738c345d6a3930bc5f44cf3e43b2031f54 (diff)
downloadnng-f31d818c02c95484b7a9c5f8667559bd2524b071.tar.gz
nng-f31d818c02c95484b7a9c5f8667559bd2524b071.tar.bz2
nng-f31d818c02c95484b7a9c5f8667559bd2524b071.zip
Pipe ID race on close (pipe IDs are zero at close).
This should address some of the errors we've seen. Additionally, the scalability test was a bit brittle due to too-short timeouts.
Diffstat (limited to 'tests')
-rw-r--r--tests/scalability.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/tests/scalability.c b/tests/scalability.c
index 16f4ba8c..1d8aeda3 100644
--- a/tests/scalability.c
+++ b/tests/scalability.c
@@ -39,7 +39,7 @@ client(void *arg)
return;
}
- timeo = 40000; // 4 seconds
+ timeo = 4000000; // 4 seconds
if (((rv = nng_setopt(s, NNG_OPT_RCVTIMEO, &timeo, sizeof (timeo))) != 0) ||
((rv = nng_setopt(s, NNG_OPT_SNDTIMEO, &timeo, sizeof (timeo))) != 0)) {
*result = rv;
@@ -49,18 +49,7 @@ client(void *arg)
// Sleep for up to a second before issuing requests to avoid saturating
// the CPU with bazillions of requests at the same time.
-
- if ((rv = nng_msg_alloc(&msg, 0)) != 0) {
- *result = rv;
- nng_close(s);
- return;
- }
- if ((rv = nng_msg_append(msg, "abc", strlen("abc"))) != 0) {
- *result = rv;
- nng_msg_free(msg);
- nng_close(s);
- return;
- }
+ nng_usleep(1000000);
for (i = 0; i < count; i++) {
// Sleep for up to a 1ms before issuing requests to