*
*/
-#include "test/core/end2end/end2end_tests.h"
-
#include <stdio.h>
#include <string.h>
#include "src/core/ext/transport/chttp2/transport/frame_ping.h"
#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/iomgr.h"
#include "test/core/end2end/cq_verifier.h"
+#include "test/core/end2end/end2end_tests.h"
+
+#ifdef GRPC_POSIX_SOCKET
+#include "src/core/lib/iomgr/ev_posix.h"
+#endif // GRPC_POSIX_SOCKET
-static void* tag(intptr_t t) { return (void*)t; }
+static void* tag(intptr_t t) { return reinterpret_cast<void*>(t); }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
const char* test_name,
* 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) {
- 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);
+#ifdef GRPC_POSIX_SOCKET
+ grpc_core::UniquePtr<char> poller = GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
+ /* It is hard to get the timing right for the polling engine poll. */
+ if ((0 == strcmp(poller.get(), "poll"))) {
return;
}
- gpr_free(poller);
+#endif // GRPC_POSIX_SOCKET
const int kPingIntervalMS = 100;
grpc_arg keepalive_arg_elems[3];
keepalive_arg_elems[0].type = GRPC_ARG_INTEGER;