aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/util
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-01-27 10:45:50 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-01-27 10:45:50 -0800
commitb0f275e4af3a18882110994713368eb288594b66 (patch)
tree749dc2e86a2a4ededca3b33ab041daff4f339fd9 /test/core/util
parent7c43f4909242b62881389c7d4cfc9541c70151b6 (diff)
Small testing fixes
- end2end test deadlines may complete before checking IsCancelled => don't expect it to be false in these cases - add exponential backoff to port_posix - ensure run_tests rebuilds targets with a regex I commonly use
Diffstat (limited to 'test/core/util')
-rw-r--r--test/core/util/port_posix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/core/util/port_posix.c b/test/core/util/port_posix.c
index 732a51c5cb..1b574f4399 100644
--- a/test/core/util/port_posix.c
+++ b/test/core/util/port_posix.c
@@ -37,6 +37,7 @@
#include "test/core/util/port.h"
+#include <math.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <stdio.h>
@@ -229,10 +230,10 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg,
grpc_httpcli_request req;
memset(&req, 0, sizeof(req));
GPR_ASSERT(pr->retries < 10);
+ sleep(1 + (unsigned)(pow(1.3, pr->retries) * rand() / RAND_MAX));
pr->retries++;
req.host = pr->server;
req.path = "/get";
- sleep(1);
grpc_httpcli_get(exec_ctx, pr->ctx, &pr->pollset, &req,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), got_port_from_server,
pr);