aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-11-28 10:09:10 -0800
committerGravatar GitHub <noreply@github.com>2016-11-28 10:09:10 -0800
commit38bfa15d2ba536c0bb17841bd2ae851248cf1931 (patch)
tree0d0cdbb89704467b1dc4da843c63aba165eb0e47 /test/core
parentcb13465fb0908e41392a648f29fbed1d9ab1fc9a (diff)
parent96583a39a9a3a929a5abb9774e3896536e537dd0 (diff)
Merge pull request #8865 from ctiller/fixit3
Up timeouts for poll-cv polling strategy
Diffstat (limited to 'test/core')
-rw-r--r--test/core/util/test_config.c18
-rw-r--r--test/core/util/test_config.h3
2 files changed, 17 insertions, 4 deletions
diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c
index 479aeda898..8e02f41b56 100644
--- a/test/core/util/test_config.c
+++ b/test/core/util/test_config.c
@@ -33,14 +33,19 @@
#include "test/core/util/test_config.h"
-#include <grpc/support/log.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/support/env.h"
#include "src/core/lib/support/string.h"
double g_fixture_slowdown_factor = 1.0;
+double g_poller_slowdown_factor = 1.0;
#if GPR_GETPID_IN_UNISTD_H
#include <unistd.h>
@@ -274,9 +279,16 @@ static void install_crash_handler() {}
void grpc_test_init(int argc, char **argv) {
install_crash_handler();
- gpr_log(GPR_DEBUG, "test slowdown: machine=%f build=%f total=%f",
+ { /* poll-cv poll strategy runs much more slowly than anything else */
+ char *s = gpr_getenv("GRPC_POLL_STRATEGY");
+ if (s != NULL && 0 == strcmp(s, "poll-cv")) {
+ g_poller_slowdown_factor = 5.0;
+ }
+ gpr_free(s);
+ }
+ gpr_log(GPR_DEBUG, "test slowdown: machine=%f build=%f poll=%f total=%f",
(double)GRPC_TEST_SLOWDOWN_MACHINE_FACTOR,
- (double)GRPC_TEST_SLOWDOWN_BUILD_FACTOR,
+ (double)GRPC_TEST_SLOWDOWN_BUILD_FACTOR, g_poller_slowdown_factor,
(double)GRPC_TEST_SLOWDOWN_FACTOR);
/* seed rng with pid, so we don't end up with the same random numbers as a
concurrently running test binary */
diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h
index 76686f1c51..c13fe86a64 100644
--- a/test/core/util/test_config.h
+++ b/test/core/util/test_config.h
@@ -49,10 +49,11 @@ extern "C" {
#endif
extern double g_fixture_slowdown_factor;
+extern double g_poller_slowdown_factor;
#define GRPC_TEST_SLOWDOWN_FACTOR \
(GRPC_TEST_SLOWDOWN_BUILD_FACTOR * GRPC_TEST_SLOWDOWN_MACHINE_FACTOR * \
- g_fixture_slowdown_factor)
+ g_fixture_slowdown_factor * g_poller_slowdown_factor)
#define GRPC_TIMEOUT_SECONDS_TO_DEADLINE(x) \
gpr_time_add( \