From a8a0e5c4de3c36df084d73694a25e4e60e915db3 Mon Sep 17 00:00:00 2001 From: David Klempner Date: Wed, 28 Jan 2015 14:41:50 -0800 Subject: [PATCH] Add a timeout to echo client's RPCs This ensures that echo test fails in a timely manner rather than hanging when it breaks. --- test/core/echo/client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/core/echo/client.c b/test/core/echo/client.c index 2ad29df53ca..2f35b03228a 100644 --- a/test/core/echo/client.c +++ b/test/core/echo/client.c @@ -78,7 +78,9 @@ int main(int argc, char **argv) { GPR_ASSERT(argc == 2); channel = grpc_channel_create(argv[1], NULL); - call = grpc_channel_create_call(channel, "/foo", "localhost", gpr_inf_future); + call = grpc_channel_create_call(channel, "/foo", "localhost", + gpr_time_add(gpr_time_from_seconds(5), + gpr_now())); GPR_ASSERT(grpc_call_invoke(call, cq, (void *)1, (void *)1, 0) == GRPC_CALL_OK);