Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions test/common/event/dispatcher_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class DispatcherImplTest : public testing::Test {
dispatcher_thread_->join();
}

NiceMock<Stats::MockStore> scope_; // Used in InitializeStats, needs to outlive dispatcher_.
Comment thread
mergeconflict marked this conversation as resolved.
Outdated
Api::ApiPtr api_;
Thread::ThreadPtr dispatcher_thread_;
DispatcherPtr dispatcher_;
Expand All @@ -96,11 +97,9 @@ class DispatcherImplTest : public testing::Test {
};

TEST_F(DispatcherImplTest, InitializeStats) {
// NiceMock because deliverHistogramToSinks may or may not be called, depending on timing.
NiceMock<Stats::MockStore> scope;
EXPECT_CALL(scope, histogram("test.dispatcher.loop_duration_us"));
EXPECT_CALL(scope, histogram("test.dispatcher.poll_delay_us"));
dispatcher_->initializeStats(scope, "test.");
EXPECT_CALL(scope_, histogram("test.dispatcher.loop_duration_us"));
EXPECT_CALL(scope_, histogram("test.dispatcher.poll_delay_us"));
dispatcher_->initializeStats(scope_, "test.");
}

TEST_F(DispatcherImplTest, Post) {
Expand Down