Skip to content

Commit

Permalink
default GRPC_IOS_EVENT_ENGINE_CLIENT to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
HannahShiSFB committed May 31, 2024
1 parent d09edb1 commit 9fc4779
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions include/grpc/support/port_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@
#define GPR_PLATFORM_STRING "ios"
#define GPR_CPU_IPHONE 1
#define GRPC_CFSTREAM 1
#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
#define GRPC_IOS_EVENT_ENGINE_CLIENT 1
#endif /* GRPC_IOS_EVENT_ENGINE_CLIENT */
/* the c-ares resolver isn't safe to enable on iOS */
#define GRPC_ARES 0
#else /* TARGET_OS_IPHONE */
Expand Down
2 changes: 1 addition & 1 deletion src/core/lib/event_engine/shim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ bool UseEventEngineClient() {
return grpc_core::IsEventEngineClientEnabled();
#elif defined(GPR_WINDOWS) && !defined(GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER)
return grpc_core::IsEventEngineClientEnabled();
#elif defined(GRPC_IOS_EVENT_ENGINE_CLIENT)
#elif GRPC_IOS_EVENT_ENGINE_CLIENT
return true;
#else
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/core/resolver/dns/dns_resolver_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
namespace grpc_core {

void RegisterDnsResolver(CoreConfiguration::Builder* builder) {
#ifdef GRPC_IOS_EVENT_ENGINE_CLIENT
#if GRPC_IOS_EVENT_ENGINE_CLIENT
VLOG(2) << "Using EventEngine dns resolver";
builder->resolver_registry()->RegisterResolverFactory(
std::make_unique<EventEngineClientChannelDNSResolverFactory>());
Expand Down
3 changes: 2 additions & 1 deletion src/objective-c/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ grpc_objc_ios_unit_test(
grpc_objc_testing_library(
name = "EventEngineClientTests-lib",
srcs = ["EventEngineTests/CFEventEngineClientTests.mm"],
# defines = ["GRPC_IOS_EVENT_ENGINE_CLIENT=1"],
# CFEventEngine is created manually, disable to allow port_server_client to work properly
defines = ["GRPC_IOS_EVENT_ENGINE_CLIENT=0"],
deps = [
"//src/core:cf_event_engine",
"//test/core/event_engine/test_suite/posix:oracle_event_engine_posix",
Expand Down
8 changes: 4 additions & 4 deletions test/core/event_engine/test_suite/tests/dns_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ MATCHER(StatusCodeEq, "") {
class EventEngineDNSTest : public EventEngineTest {
protected:
static void SetUpTestSuite() {
#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
#if !GRPC_IOS_EVENT_ENGINE_CLIENT
std::string test_records_path = kDNSTestRecordGroupsYamlPath;
std::string dns_server_path = kDNSServerRelPath;
std::string dns_resolver_path = kDNSResolverRelPath;
Expand Down Expand Up @@ -182,7 +182,7 @@ class EventEngineDNSTest : public EventEngineTest {
}

static void TearDownTestSuite() {
#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
#if !GRPC_IOS_EVENT_ENGINE_CLIENT
dns_server_.server_process->Interrupt();
dns_server_.server_process->Join();
delete dns_server_.server_process;
Expand Down Expand Up @@ -233,7 +233,7 @@ class EventEngineDNSTest : public EventEngineTest {
EventEngineDNSTest::DNSServer EventEngineDNSTest::dns_server_;

// TODO(hork): implement XFAIL for resolvers that don't support TXT or SRV
#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
#if !GRPC_IOS_EVENT_ENGINE_CLIENT

TEST_F(EventEngineDNSTest, QueryNXHostname) {
SKIP_TEST_FOR_NATIVE_DNS_RESOLVER();
Expand Down Expand Up @@ -434,7 +434,7 @@ TEST_F(EventEngineDNSTest, LocalHost) {
auto dns_resolver = CreateDNSResolverWithoutSpecifyingServer();
dns_resolver->LookupHostname(
[this](auto result) {
#ifdef GRPC_IOS_EVENT_ENGINE_CLIENT
#if GRPC_IOS_EVENT_ENGINE_CLIENT
EXPECT_SUCCESS();
#else
EXPECT_TRUE(result.ok());
Expand Down

0 comments on commit 9fc4779

Please sign in to comment.