aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/tests/thread_stress.c
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-02-26 09:30:36 -0800
committerGravatar Yang Gao <yangg@google.com>2015-02-26 09:30:36 -0800
commit0e32857bfdab7422b22508fac833d7c651470691 (patch)
tree3bc397d6f1bf3c47639900df482cb72876626809 /test/core/end2end/tests/thread_stress.c
parentc33731aea655720293576e77ec4d5f04e1f7d545 (diff)
parentc1f1162787a84abdbc6cbe1717909692fad41261 (diff)
Merge pull request #784 from ctiller/timeout
Introduce slowdown factor for unit test deadlines
Diffstat (limited to 'test/core/end2end/tests/thread_stress.c')
-rw-r--r--test/core/end2end/tests/thread_stress.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/core/end2end/tests/thread_stress.c b/test/core/end2end/tests/thread_stress.c
index 996229c228..a42956f7bc 100644
--- a/test/core/end2end/tests/thread_stress.c
+++ b/test/core/end2end/tests/thread_stress.c
@@ -41,6 +41,7 @@
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpc/support/thd.h>
+#include "test/core/util/test_config.h"
#define SERVER_THREADS 16
#define CLIENT_THREADS 16
@@ -53,7 +54,7 @@ static gpr_mu g_mu;
static int g_active_requests;
static gpr_timespec n_seconds_time(int n) {
- return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
+ return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n);
}
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
@@ -280,11 +281,11 @@ static void run_test(grpc_end2end_test_config config, int requests_in_flight) {
/* kick off threads */
for (i = 0; i < CLIENT_THREADS; i++) {
gpr_event_init(&g_client_done[i]);
- gpr_thd_new(&thd_id, client_thread, (void *)(gpr_intptr)i, NULL);
+ gpr_thd_new(&thd_id, client_thread, (void *)(gpr_intptr) i, NULL);
}
for (i = 0; i < SERVER_THREADS; i++) {
gpr_event_init(&g_server_done[i]);
- gpr_thd_new(&thd_id, server_thread, (void *)(gpr_intptr)i, NULL);
+ gpr_thd_new(&thd_id, server_thread, (void *)(gpr_intptr) i, NULL);
}
/* start requests */