From f2876ea1e0bbb3639007856cf7ea528a19d2d965 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 28 Nov 2016 08:57:48 -0800 Subject: [PATCH 1/2] Up timeouts for poll-cv polling strategy, seems to make things more stable --- test/core/util/test_config.c | 21 ++++++++++++++++++--- test/core/util/test_config.h | 3 ++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c index 479aeda8984..046e4beed16 100644 --- a/test/core/util/test_config.c +++ b/test/core/util/test_config.c @@ -33,14 +33,20 @@ #include "test/core/util/test_config.h" -#include #include #include #include #include + +#include +#include + +#include "src/core/lib/iomgr/port.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 @@ -274,9 +280,18 @@ 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", +#ifdef GRPC_POSIX_SOCKET + { /* 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); + } +#endif + 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 76686f1c51b..c13fe86a649 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( \ From 96583a39a9a3a929a5abb9774e3896536e537dd0 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 28 Nov 2016 09:36:17 -0800 Subject: [PATCH 2/2] Remove file dependency to simplify build graph --- test/core/util/test_config.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c index 046e4beed16..8e02f41b560 100644 --- a/test/core/util/test_config.c +++ b/test/core/util/test_config.c @@ -41,7 +41,6 @@ #include #include -#include "src/core/lib/iomgr/port.h" #include "src/core/lib/support/env.h" #include "src/core/lib/support/string.h" @@ -280,7 +279,6 @@ static void install_crash_handler() {} void grpc_test_init(int argc, char **argv) { install_crash_handler(); -#ifdef GRPC_POSIX_SOCKET { /* 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")) { @@ -288,7 +286,6 @@ void grpc_test_init(int argc, char **argv) { } gpr_free(s); } -#endif 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, g_poller_slowdown_factor,