aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/util
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-01-27 19:57:58 -0800
committerGravatar David Garcia Quintas <dgq@google.com>2016-01-27 19:57:58 -0800
commitb4e51b52bdd3a41f44e4959d08957f7142c9c56a (patch)
tree699df3ca4dfe307dc9e139dab565dc1db1a700fe /test/core/util
parent5a9462339dd35de13acd44e7c8a001ac727c038e (diff)
parentf846aaf41baf34d68f9aa7e3daa2c65cd75dd7f1 (diff)
Merge branch 'master' of github.com:grpc/grpc into sync-async-plus-interfaces
Diffstat (limited to 'test/core/util')
-rw-r--r--test/core/util/port_posix.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/core/util/port_posix.c b/test/core/util/port_posix.c
index 732a51c5cb..0666a60c66 100644
--- a/test/core/util/port_posix.c
+++ b/test/core/util/port_posix.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,11 +37,12 @@
#include "test/core/util/port.h"
+#include <errno.h>
+#include <math.h>
#include <netinet/in.h>
-#include <sys/socket.h>
#include <stdio.h>
-#include <errno.h>
#include <string.h>
+#include <sys/socket.h>
#include <unistd.h>
#include <grpc/grpc.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);