From bfd89bcec589298780af86336b39ead756775a95 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Wed, 6 Feb 2019 17:56:03 -0800 Subject: [PATCH] Don't run for poll and poll-cv --- test/core/end2end/tests/keepalive_timeout.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/core/end2end/tests/keepalive_timeout.cc b/test/core/end2end/tests/keepalive_timeout.cc index 38ff37fca6a..f39a33cff9b 100644 --- a/test/core/end2end/tests/keepalive_timeout.cc +++ b/test/core/end2end/tests/keepalive_timeout.cc @@ -91,7 +91,6 @@ static void end_test(grpc_end2end_test_fixture* f) { /* Client sends a request, server replies with a payload, then waits for the keepalive watchdog timeouts before returning status. */ -#if 0 static void test_keepalive_timeout(grpc_end2end_test_config config) { grpc_call* c; grpc_call* s; @@ -220,15 +219,20 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { end_test(&f); config.tear_down_data(&f); } -#endif /* Verify that reads reset the keepalive ping timer. The client sends 30 pings * with a sleep of 10ms in between. It has a configured keepalive timer of * 200ms. In the success case, each ping ack should reset the keepalive timer so * that the keepalive ping is never sent. */ static void test_read_delays_keepalive(grpc_end2end_test_config config) { - gpr_log(GPR_ERROR, "ura"); - const int kPingIntervalMS = 5; + char* poller = gpr_getenv("GRPC_POLL_STRATEGY"); + /* It is hard to get the timing right for the polling engines poll and poll-cv */ + if(poller != nullptr && (0 == strcmp(poller, "poll-cv") || 0 == strcmp(poller, "poll"))) { + gpr_free(poller); + return; + } + gpr_free(poller); + const int kPingIntervalMS = 100; grpc_arg keepalive_arg_elems[3]; keepalive_arg_elems[0].type = GRPC_ARG_INTEGER; keepalive_arg_elems[0].key = const_cast(GRPC_ARG_KEEPALIVE_TIME_MS); @@ -377,9 +381,7 @@ static void test_read_delays_keepalive(grpc_end2end_test_config config) { grpc_byte_buffer_destroy(request_payload_recv); grpc_byte_buffer_destroy(response_payload_recv); /* Sleep for a short interval to check if the client sends any pings */ - gpr_log(GPR_ERROR, "before sleep"); gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(kPingIntervalMS)); - gpr_log(GPR_ERROR, "after sleep"); } grpc_slice_unref(request_payload_slice); @@ -431,7 +433,7 @@ static void test_read_delays_keepalive(grpc_end2end_test_config config) { } void keepalive_timeout(grpc_end2end_test_config config) { - // test_keepalive_timeout(config); + test_keepalive_timeout(config); test_read_delays_keepalive(config); }