aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/util/test_config.h
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-02-06 13:40:43 -0800
committerGravatar Muxi Yan <mxyan@google.com>2017-02-06 13:40:43 -0800
commit7a008c9311c037524b3401c81983e8788d71d679 (patch)
tree3a619e8be6d0d425a621bcda4f8758e276579f69 /test/core/util/test_config.h
parent1783bd3c99c51b75402fac2195926c1ffd3b6c72 (diff)
parentd6d2677637fee5d2988dae08cee1b909d822c650 (diff)
Merge remote-tracking branch 'upstream/master' into automate-objc-version-advancement
Diffstat (limited to 'test/core/util/test_config.h')
-rw-r--r--test/core/util/test_config.h31
1 files changed, 8 insertions, 23 deletions
diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h
index c13fe86a64..491f011fc8 100644
--- a/test/core/util/test_config.h
+++ b/test/core/util/test_config.h
@@ -40,32 +40,17 @@
extern "C" {
#endif /* __cplusplus */
-#ifndef GRPC_TEST_SLOWDOWN_BUILD_FACTOR
-#define GRPC_TEST_SLOWDOWN_BUILD_FACTOR 1.0
-#endif
-
-#ifndef GRPC_TEST_SLOWDOWN_MACHINE_FACTOR
-#define GRPC_TEST_SLOWDOWN_MACHINE_FACTOR 1.0
-#endif
-
-extern double g_fixture_slowdown_factor;
-extern double g_poller_slowdown_factor;
+extern int64_t g_fixture_slowdown_factor;
+extern int64_t g_poller_slowdown_factor;
-#define GRPC_TEST_SLOWDOWN_FACTOR \
- (GRPC_TEST_SLOWDOWN_BUILD_FACTOR * GRPC_TEST_SLOWDOWN_MACHINE_FACTOR * \
- g_fixture_slowdown_factor * g_poller_slowdown_factor)
+/* Returns an appropriate scaling factor for timeouts. */
+int64_t grpc_test_slowdown_factor();
-#define GRPC_TIMEOUT_SECONDS_TO_DEADLINE(x) \
- gpr_time_add( \
- gpr_now(GPR_CLOCK_MONOTONIC), \
- gpr_time_from_millis((int64_t)(GRPC_TEST_SLOWDOWN_FACTOR * 1e3 * (x)), \
- GPR_TIMESPAN))
+/* Converts a given timeout (in seconds) to a deadline. */
+gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s);
-#define GRPC_TIMEOUT_MILLIS_TO_DEADLINE(x) \
- gpr_time_add( \
- gpr_now(GPR_CLOCK_MONOTONIC), \
- gpr_time_from_micros((int64_t)(GRPC_TEST_SLOWDOWN_FACTOR * 1e3 * (x)), \
- GPR_TIMESPAN))
+/* Converts a given timeout (in milliseconds) to a deadline. */
+gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms);
#ifndef GRPC_TEST_CUSTOM_PICK_PORT
#define GRPC_TEST_PICK_PORT