Skip to content

Commit

Permalink
Merge pull request grpc#20040 from rmstar/timertestem
Browse files Browse the repository at this point in the history
Skip timer test when running under event manager
  • Loading branch information
markdroth authored Aug 23, 2019
2 parents fe2fb14 + 9a41e12 commit 8ae5494
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/cpp/common/timer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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(); }
Expand Down

0 comments on commit 8ae5494

Please sign in to comment.