diff options
author | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2015-08-06 09:55:02 -0700 |
---|---|---|
committer | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2015-08-06 09:55:02 -0700 |
commit | 0a6012688ab60d7fed478f5afd8db6494d4a6bb0 (patch) | |
tree | 865c798631c283e50bb370dbaabc3eb80c4a02be /test/core/util | |
parent | 5a2017036dbb44ec413831c13dbd81f6564d5fb4 (diff) | |
parent | 7b9ed35a2c0bc8d9c80492531443100d132f7489 (diff) |
Merge pull request #2783 from ctiller/tracing-takes-time
Allow fixtures to specify slowdown factors, use it for grpc_trace tests
Diffstat (limited to 'test/core/util')
-rw-r--r-- | test/core/util/test_config.c | 2 | ||||
-rw-r--r-- | test/core/util/test_config.h | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c index 225658f5e2..cadf88a7c6 100644 --- a/test/core/util/test_config.c +++ b/test/core/util/test_config.c @@ -38,6 +38,8 @@ #include <stdlib.h> #include <signal.h> +double g_fixture_slowdown_factor = 1.0; + #if GPR_GETPID_IN_UNISTD_H #include <unistd.h> static int seed(void) { return getpid(); } diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h index 7028ade7b2..b2cc40bb47 100644 --- a/test/core/util/test_config.h +++ b/test/core/util/test_config.h @@ -48,8 +48,11 @@ extern "C" { #define GRPC_TEST_SLOWDOWN_MACHINE_FACTOR 1.0 #endif -#define GRPC_TEST_SLOWDOWN_FACTOR \ - (GRPC_TEST_SLOWDOWN_BUILD_FACTOR * GRPC_TEST_SLOWDOWN_MACHINE_FACTOR) +extern double g_fixture_slowdown_factor; + +#define GRPC_TEST_SLOWDOWN_FACTOR \ + (GRPC_TEST_SLOWDOWN_BUILD_FACTOR * GRPC_TEST_SLOWDOWN_MACHINE_FACTOR * \ + g_fixture_slowdown_factor) #define GRPC_TIMEOUT_SECONDS_TO_DEADLINE(x) \ gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), \ |