From e7ee62ccb25fda20bc4a88ddca9c90a411f11971 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 5 Jan 2024 20:50:45 +0000 Subject: [PATCH] x --- include/grpcpp/test/channel_test_peer.h | 1 - src/core/lib/surface/channel.cc | 1 - src/core/lib/surface/channel.h | 6 ------ src/cpp/client/channel_test_peer.cc | 5 ----- test/cpp/end2end/end2end_test.cc | 2 -- 5 files changed, 15 deletions(-) diff --git a/include/grpcpp/test/channel_test_peer.h b/include/grpcpp/test/channel_test_peer.h index b180b8feda1..f4aad2a03b5 100644 --- a/include/grpcpp/test/channel_test_peer.h +++ b/include/grpcpp/test/channel_test_peer.h @@ -32,7 +32,6 @@ class ChannelTestPeer { /// Provide the gRPC Core channel grpc_channel* channel() const { return channel_->c_channel_; } int registered_calls() const; - int registration_attempts() const; private: Channel* channel_; // not owned diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc index ca8927fc7e3..17d36b50e9a 100644 --- a/src/core/lib/surface/channel.cc +++ b/src/core/lib/surface/channel.cc @@ -376,7 +376,6 @@ namespace grpc_core { RegisteredCall* Channel::RegisterCall(const char* method, const char* host) { MutexLock lock(®istration_table_.mu); - registration_table_.method_registration_attempts++; auto key = std::make_pair(std::string(host != nullptr ? host : ""), std::string(method != nullptr ? method : "")); auto rc_posn = registration_table_.map.find(key); diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h index 2efe91fbfc2..f6e4f7ed932 100644 --- a/src/core/lib/surface/channel.h +++ b/src/core/lib/surface/channel.h @@ -103,7 +103,6 @@ struct CallRegistrationTable { // C++ or other wrapped language Channel that registered these calls). std::map, RegisteredCall> map ABSL_GUARDED_BY(mu); - int method_registration_attempts ABSL_GUARDED_BY(mu) = 0; }; class Channel : public RefCounted, @@ -150,11 +149,6 @@ class Channel : public RefCounted, return registration_table_.map.size(); } - int TestOnlyRegistrationAttempts() { - MutexLock lock(®istration_table_.mu); - return registration_table_.method_registration_attempts; - } - grpc_event_engine::experimental::EventEngine* event_engine() const { return channel_stack_->EventEngine(); } diff --git a/src/cpp/client/channel_test_peer.cc b/src/cpp/client/channel_test_peer.cc index e8b2f72c058..f694a749d16 100644 --- a/src/cpp/client/channel_test_peer.cc +++ b/src/cpp/client/channel_test_peer.cc @@ -29,10 +29,5 @@ int ChannelTestPeer::registered_calls() const { ->TestOnlyRegisteredCalls(); } -int ChannelTestPeer::registration_attempts() const { - return grpc_core::Channel::FromC(channel_->c_channel_) - ->TestOnlyRegistrationAttempts(); -} - } // namespace testing } // namespace grpc diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 7fc2d33132a..40964abe03f 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -862,12 +862,10 @@ TEST_P(End2endTest, ManyStubs) { ResetStub(); ChannelTestPeer peer(channel_.get()); int registered_calls_pre = peer.registered_calls(); - int registration_attempts_pre = peer.registration_attempts(); for (int i = 0; i < 1000; ++i) { grpc::testing::EchoTestService::NewStub(channel_); } EXPECT_EQ(peer.registered_calls(), registered_calls_pre); - EXPECT_GT(peer.registration_attempts(), registration_attempts_pre); } TEST_P(End2endTest, EmptyBinaryMetadata) {