diff options
author | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2018-01-18 14:28:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-18 14:28:08 +0100 |
commit | 6a365ccc6d1557b131c86631965c448b01b1f724 (patch) | |
tree | 04d7bd4d7110ffa55fb54fe4b267a1f424fe80f9 /test | |
parent | 143fb810cc4c449f1faba2ba9710524627cd1793 (diff) | |
parent | 0f5f46109b995aab3bb5f8ffeadd96547de7e100 (diff) |
Merge pull request #14046 from jtattermusch/try_fixing_dualstack_socket_test
Try avoid deadline_exceeded failure in dualstack_socket_test
Diffstat (limited to 'test')
-rw-r--r-- | test/core/end2end/dualstack_socket_test.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/core/end2end/dualstack_socket_test.cc b/test/core/end2end/dualstack_socket_test.cc index 2ba1c17c2c..04c727e689 100644 --- a/test/core/end2end/dualstack_socket_test.cc +++ b/test/core/end2end/dualstack_socket_test.cc @@ -43,14 +43,11 @@ static void* tag(intptr_t i) { return (void*)i; } -static gpr_timespec ms_from_now(int ms) { - return grpc_timeout_milliseconds_to_deadline(ms); -} - static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, ms_from_now(5000), nullptr); + ev = grpc_completion_queue_next( + cq, grpc_timeout_milliseconds_to_deadline(5000), nullptr); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -165,11 +162,11 @@ void test_connect(const char* server_host, const char* client_host, int port, if (expect_ok) { /* Normal deadline, shouldn't be reached. */ - deadline = ms_from_now(60000); + deadline = grpc_timeout_milliseconds_to_deadline(60000); } else { /* Give up faster when failure is expected. BUG: Setting this to 1000 reveals a memory leak (b/18608927). */ - deadline = ms_from_now(1500); + deadline = grpc_timeout_milliseconds_to_deadline(3000); } /* Send a trivial request. */ |