aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/tests/max_connection_age.c
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2017-03-30 15:31:29 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2017-04-04 13:56:47 -0700
commita2ca7247ae7345dce987a3542a816f4e101a9345 (patch)
tree142150bbf9ef8a37a21dc3ed2d0a6ce8f39eb8db /test/core/end2end/tests/max_connection_age.c
parentca38800d6236835d3907b8c29e6faeebe31ffeb7 (diff)
Add max_connection_age jitter
Diffstat (limited to 'test/core/end2end/tests/max_connection_age.c')
-rw-r--r--test/core/end2end/tests/max_connection_age.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/core/end2end/tests/max_connection_age.c b/test/core/end2end/tests/max_connection_age.c
index 59bfdbabb9..04bdb39445 100644
--- a/test/core/end2end/tests/max_connection_age.c
+++ b/test/core/end2end/tests/max_connection_age.c
@@ -47,6 +47,7 @@
#define MAX_CONNECTION_AGE_GRACE_MS 1000
#define MAX_CONNECTION_IDLE_MS 9999
+#define MAX_CONNECTION_AGE_JITTER_MULTIPLIER 1.1
#define CALL_DEADLINE_S 10
/* The amount of time we wait for the connection to time out, but after it the
connection should not use up its grace period. It should be a number between
@@ -169,8 +170,8 @@ static void test_max_age_forcibly_close(grpc_end2end_test_config config) {
cq_verify(cqv);
gpr_timespec expect_shutdown_time = grpc_timeout_milliseconds_to_deadline(
- MAX_CONNECTION_AGE_MS + MAX_CONNECTION_AGE_GRACE_MS +
- IMMEDIATE_SHUTDOWN_GRACE_TIME_MS);
+ (int)(MAX_CONNECTION_AGE_MS * MAX_CONNECTION_AGE_JITTER_MULTIPLIER) +
+ MAX_CONNECTION_AGE_GRACE_MS + IMMEDIATE_SHUTDOWN_GRACE_TIME_MS);
/* Wait for the channel to reach its max age */
cq_verify_empty_timeout(cqv, CQ_MAX_CONNECTION_AGE_WAIT_TIME_S);