diff options
author | Yang Gao <yangg@google.com> | 2017-04-04 14:20:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-04 14:20:55 -0700 |
commit | c02f36bc9ec4baab246c1bd869d679ed19ab8580 (patch) | |
tree | 20c18a90135e90d07d31429a4bfe8d9ab5063762 /test/core/end2end/tests/graceful_server_shutdown.c | |
parent | ca38800d6236835d3907b8c29e6faeebe31ffeb7 (diff) | |
parent | ed2a5470dbf2154aa3bd6ed44ad6151d557b4446 (diff) |
Merge pull request #10334 from wcevans/master
Calculate RPC deadline right before call creation
Diffstat (limited to 'test/core/end2end/tests/graceful_server_shutdown.c')
-rw-r--r-- | test/core/end2end/tests/graceful_server_shutdown.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c index a3ad260cc2..182bb20780 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.c +++ b/test/core/end2end/tests/graceful_server_shutdown.c @@ -57,16 +57,18 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, return f; } -static gpr_timespec n_seconds_time(int n) { +static gpr_timespec n_seconds_from_now(int n) { return grpc_timeout_seconds_to_deadline(n); } -static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } +static gpr_timespec five_seconds_from_now(void) { + return n_seconds_from_now(5); +} static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); + ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -95,7 +97,6 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - gpr_timespec deadline = n_seconds_time(10); grpc_end2end_test_fixture f = begin_test( config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL); cq_verifier *cqv = cq_verifier_create(f.cq); @@ -110,6 +111,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_slice details; int was_cancelled = 2; + gpr_timespec deadline = n_seconds_from_now(10); c = grpc_channel_create_call( f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, grpc_slice_from_static_string("/foo"), |