diff --git a/test/cpp/common/timer_test.cc b/test/cpp/common/timer_test.cc index f5083d66e76da..0ce6633088f31 100644 --- a/test/cpp/common/timer_test.cc +++ b/test/cpp/common/timer_test.cc @@ -27,6 +27,10 @@ #include "src/core/lib/iomgr/timer_manager.h" #include "test/core/util/test_config.h" +#ifdef GRPC_POSIX_SOCKET +#include "src/core/lib/iomgr/ev_posix.h" +#endif + // MAYBE_SKIP_TEST is a macro to determine if this particular test configuration // should be skipped based on a decision made at SetUp time. #define MAYBE_SKIP_TEST \ @@ -39,9 +43,17 @@ class TimerTest : public ::testing::Test { protected: void SetUp() override { - // Skip test if slowdown factor > 1. - do_not_test_ = (grpc_test_slowdown_factor() != 1); grpc_init(); + // Skip test if slowdown factor > 1, or we are + // using event manager. +#ifdef GRPC_POSIX_SOCKET + if (grpc_test_slowdown_factor() != 1 || + grpc_event_engine_run_in_background()) { +#else + if (grpc_test_slowdown_factor() != 1) { +#endif + do_not_test_ = true; + } } void TearDown() override { grpc_shutdown_blocking(); }