[maintenance] Fix cpp typos (#37755)

Continuation of #37541 but focused on C++.

Closes #37755

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37755 from NathanBaulch:typos-cpp 9a7fd9d65f
PiperOrigin-RevId: 684600898
pull/37813/head
Nathan Baulch 2 months ago committed by Copybara-Service
parent bac52d8d52
commit b2a05bebe0
  1. 2
      examples/cpp/unix_abstract_sockets/README.md
  2. 2
      src/cpp/README.md
  3. 2
      src/cpp/ext/filters/census/server_call_tracer.cc
  4. 2
      src/cpp/ext/gcp/observability_config.cc
  5. 2
      src/cpp/server/server_cc.cc
  6. 6
      src/cpp/thread_manager/thread_manager.h
  7. 2
      templates/test/cpp/naming/resolver_component_tests_defs.include
  8. 2
      test/cpp/README-iOS.md
  9. 2
      test/cpp/cocoapods/Podfile
  10. 4
      test/cpp/end2end/async_end2end_test.cc
  11. 2
      test/cpp/end2end/cfstream_test.cc
  12. 2
      test/cpp/end2end/channelz_service_test.cc
  13. 2
      test/cpp/end2end/client_callback_end2end_test.cc
  14. 2
      test/cpp/end2end/client_lb_end2end_test.cc
  15. 2
      test/cpp/end2end/end2end_test.cc
  16. 2
      test/cpp/end2end/proto_server_reflection_test.cc
  17. 4
      test/cpp/end2end/xds/xds_outlier_detection_end2end_test.cc
  18. 12
      test/cpp/end2end/xds/xds_server.h
  19. 2
      test/cpp/interop/interop_client.h
  20. 4
      test/cpp/interop/istio_echo_server.cc
  21. 2
      test/cpp/interop/metrics_client.cc
  22. 2
      test/cpp/microbenchmarks/bm_event_engine_run.cc
  23. 6
      test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h
  24. 2
      test/cpp/naming/resolver_component_tests_runner.py
  25. 2
      test/cpp/naming/resolver_component_tests_runner_invoker.cc
  26. 2
      test/cpp/naming/utils/dns_server.py
  27. 2
      test/cpp/naming/utils/health_check.py
  28. 5
      test/cpp/qps/qps_json_driver.cc
  29. 8
      test/cpp/server/load_reporter/load_data_store_test.cc
  30. 4
      test/cpp/util/cli_call.h
  31. 2
      test/distrib/cpp/run_distrib_test_cmake.bat
  32. 2
      test/distrib/cpp/run_distrib_test_cmake_for_dll.bat

@ -3,7 +3,7 @@ gRPC Unix Abstract Socket Example
This example shows how to use gRPC with Unix domain sockets in the abstract namespace.
gRPC uses the [`unix-abstract:abstract_path`](https://github.com/grpc/grpc/blob/c6844099218b147b0e374843e0a26745adc61ddb/doc/naming.md?plain=1#L44-L50) URI scheme to support this.
In this example, an socket with an embedded null character `grpc%00abstract` is created.
In this example, a socket with an embedded null character `grpc%00abstract` is created.
## Build and run the example

@ -18,7 +18,7 @@ Therefore, gRPC supports several major build systems, which should satisfy most
them.
.
* Best Effort: We do not have continous integration tests for these, but we are
* Best Effort: We do not have continuous integration tests for these, but we are
fairly confident that gRPC C++ would work on them. We will make our best
effort to support them, and we welcome patches for such platforms, but we
might need to declare bankruptcy on some issues.

@ -194,7 +194,7 @@ class OpenCensusServerCallTracer : public grpc_core::ServerCallTracer {
absl::Duration elapsed_time_;
uint64_t recv_message_count_;
uint64_t sent_message_count_;
// Buffer needed for grpc_slice to reference it when adding metatdata to
// Buffer needed for grpc_slice to reference it when adding metadata to
// response.
char stats_buf_[kMaxServerStatsLen];
// TODO(roth, ctiller): Won't need atomic here once chttp2 is migrated

@ -75,7 +75,7 @@ absl::StatusOr<std::string> GetGcpObservabilityConfigContents() {
// Tries to get the GCP Project ID from environment variables, or returns an
// empty string if not found.
std::string GetProjectIdFromGcpEnvVar() {
// First check GCP_PROEJCT
// First check GCP_PROJECT
absl::optional<std::string> project_id = grpc_core::GetEnv("GCP_PROJECT");
if (project_id.has_value() && !project_id->empty()) {
return project_id.value();

@ -530,7 +530,7 @@ class Server::SyncRequest final : public grpc::internal::CompletionQueueTag {
grpc::internal::InterceptorBatchMethodsImpl interceptor_methods_;
// ServerContextWrapper allows ManualConstructor while using a private
// contructor of ServerContext via this friend class.
// constructor of ServerContext via this friend class.
struct ServerContextWrapper {
ServerContext ctx;

@ -42,10 +42,10 @@ class ThreadManager {
// "Polls" for new work.
// If the return value is WORK_FOUND:
// - The implementaion of PollForWork() MAY set some opaque identifier to
// - The implementation of PollForWork() MAY set some opaque identifier to
// (identify the work item found) via the '*tag' parameter
// - The implementaion MUST set the value of 'ok' to 'true' or 'false'. A
// value of 'false' indicates some implemenation specific error (that is
// - The implementation MUST set the value of 'ok' to 'true' or 'false'. A
// value of 'false' indicates some implementation specific error (that is
// neither SHUTDOWN nor TIMEOUT)
// - ThreadManager does not interpret the values of 'tag' and 'ok'
// - ThreadManager WILL call DoWork() and pass '*tag' and 'ok' as input to

@ -92,7 +92,7 @@ def wait_until_dns_server_is_up(args,
dns_server_subprocess.kill()
dns_server_subprocess.wait()
test_runner_log(('Failed to reach DNS server over TCP and/or UDP. '
'Exitting without running tests.'))
'Exiting without running tests.'))
test_runner_log('======= DNS server stdout '
'(merged stdout and stderr) =============')
with open(dns_server_subprocess_output, 'r') as l:

@ -5,7 +5,7 @@ However, it's ok to call `::testing::InitGoogleTest` in `main`, as `GTMGoogleTes
`grpc::testing::TestEnvironment` can also be called from `main`, as it does some test initialization (install crash handler, seed RNG) that's not strictly required to run testcases on iOS.
## Porting exising C++ tests to run on iOS
## Porting existing C++ tests to run on iOS
Please follow these guidelines when porting tests to run on iOS:

@ -25,7 +25,7 @@ post_install do |installer|
# CocoaPods creates duplicated library targets of gRPC-Core when the test targets include
# non-default subspecs of gRPC-Core. All of these library targets start with prefix 'gRPC-Core'
# and require the same error suppresion.
# and require the same error suppression.
if target.name.start_with?('gRPC-Core')
target.build_configurations.each do |config|
# TODO(zyc): Remove this setting after the issue is resolved

@ -234,7 +234,7 @@ bool plugin_has_sync_methods(std::unique_ptr<ServerBuilderPlugin>& plugin) {
}
// This class disables the server builder plugins that may add sync services to
// the server. If there are sync services, UnimplementedRpc test will triger
// the server. If there are sync services, UnimplementedRpc test will trigger
// the sync unknown rpc routine on the server side, rather than the async one
// that needs to be tested here.
class ServerBuilderSyncPluginDisabler : public grpc::ServerBuilderOption {
@ -322,7 +322,7 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<TestScenario> {
}
cq_ = builder.AddCompletionQueue();
// TODO(zyc): make a test option to choose wheather sync plugins should be
// TODO(zyc): make a test option to choose whether sync plugins should be
// deleted
std::unique_ptr<ServerBuilderOption> sync_plugin_disabler(
new ServerBuilderSyncPluginDisabler());

@ -312,7 +312,7 @@ std::vector<TestScenario> CreateTestScenarios() {
INSTANTIATE_TEST_SUITE_P(CFStreamTest, CFStreamTest,
::testing::ValuesIn(CreateTestScenarios()));
// gRPC should automatically detech network flaps (without enabling keepalives)
// gRPC should automatically detect network flaps (without enabling keepalives)
// when CFStream is enabled
TEST_P(CFStreamTest, NetworkTransition) {
auto channel = BuildChannel();

@ -216,7 +216,7 @@ class ChannelzServerTest : public ::testing::TestWithParam<CredentialsType> {
backends_.clear();
proxy_service_.reset();
// Ensure all pending callbacks are handled before finishing the test
// to ensure hygene between test cases.
// to ensure hygiene between test cases.
// (requires any grpc-object-holding values be cleared out first).
grpc_event_engine::experimental::WaitForSingleOwner(
grpc_event_engine::experimental::GetDefaultEventEngine());

@ -1055,7 +1055,7 @@ TEST_P(ClientCallbackEnd2endTest, ResponseStreamServerCancelDuring) {
}
}
// Server to cancel after writing all the respones to the stream but before
// Server to cancel after writing all the responses to the stream but before
// returning to the client
TEST_P(ClientCallbackEnd2endTest, ResponseStreamServerCancelAfter) {
ResetStub();

@ -1021,7 +1021,7 @@ TEST_F(PickFirstTest, BackOffMinReconnect) {
const grpc_core::Duration waited =
grpc_core::Duration::FromTimespec(gpr_time_sub(t1, t0));
VLOG(2) << "Waited " << waited.millis() << " milliseconds";
// We should have waited at least kMinReconnectBackOffMs. We substract one to
// We should have waited at least kMinReconnectBackOffMs. We subtract one to
// account for test and precision accuracy drift.
EXPECT_GE(waited.millis(),
(kMinReconnectBackOffMs * grpc_test_slowdown_factor()) - 1);

@ -786,7 +786,7 @@ TEST_P(End2endServerTryCancelTest, ResponseStreamServerCancelDuring) {
TestResponseStreamServerCancel(CANCEL_DURING_PROCESSING);
}
// Server to cancel after writing all the respones to the stream but before
// Server to cancel after writing all the responses to the stream but before
// returning to the client
TEST_P(End2endServerTryCancelTest, ResponseStreamServerCancelAfter) {
TestResponseStreamServerCancel(CANCEL_AFTER_PROCESSING);

@ -147,7 +147,7 @@ TEST_F(ProtoServerReflectionTest, CheckResponseWithLocalDescriptorPool) {
std::vector<std::string> services;
desc_db_->GetServices(&services);
// The service list has at least one service (reflection servcie).
// The service list has at least one service (reflection service).
EXPECT_TRUE(!services.empty());
for (auto it = services.begin(); it != services.end(); ++it) {

@ -185,7 +185,7 @@ TEST_P(OutlierDetectionTest, SuccessRateMaxPercent) {
EXPECT_LE(absl::Now(), deadline);
if (absl::Now() >= deadline) break;
}
// 1 backend should be ejected, trafficed picked up by another backend.
// 1 backend should be ejected, traffic picked up by another backend.
// No other backend should be ejected.
ResetBackendCounters();
CheckRpcSendOk(DEBUG_LOCATION, 100, rpc_options);
@ -599,7 +599,7 @@ TEST_P(OutlierDetectionTest, FailurePercentageMaxPercentage) {
EXPECT_LE(absl::Now(), deadline);
if (absl::Now() >= deadline) break;
}
// 1 backend should be ejected, trafficed picked up by another backend.
// 1 backend should be ejected, traffic picked up by another backend.
// No other backend should be ejected.
ResetBackendCounters();
CheckRpcSendOk(DEBUG_LOCATION, 100, rpc_options);

@ -131,9 +131,9 @@ class AdsServiceImpl
// Sets a callback to be invoked on request messages with respoonse_nonce
// set. The callback is passed the resource type and version.
void SetCheckVersionCallback(
std::function<void(absl::string_view, int)> check_version_callack) {
std::function<void(absl::string_view, int)> check_version_callback) {
grpc_core::MutexLock lock(&ads_mu_);
check_version_callack_ = std::move(check_version_callack);
check_version_callback_ = std::move(check_version_callback);
}
// Get the list of response state for each resource type.
@ -368,9 +368,9 @@ class AdsServiceImpl
CHECK(absl::SimpleAtoi(request.version_info(),
&client_resource_type_version));
}
if (check_version_callack_ != nullptr) {
check_version_callack_(request.type_url(),
client_resource_type_version);
if (check_version_callback_ != nullptr) {
check_version_callback_(request.type_url(),
client_resource_type_version);
}
} else {
int client_nonce;
@ -586,7 +586,7 @@ class AdsServiceImpl
resource_type_response_state_ ABSL_GUARDED_BY(ads_mu_);
std::set<std::string /*resource_type*/> resource_types_to_ignore_
ABSL_GUARDED_BY(ads_mu_);
std::function<void(absl::string_view, int)> check_version_callack_
std::function<void(absl::string_view, int)> check_version_callback_
ABSL_GUARDED_BY(ads_mu_);
// An instance data member containing the current state of all resources.
// Note that an entry will exist whenever either of the following is true:

@ -116,7 +116,7 @@ class InteropClient {
public:
typedef std::function<std::shared_ptr<Channel>()> ChannelCreationFunc;
// If new_stub_every_call = true, pointer to a new instance of
// TestServce::Stub is returned by Get() everytime it is called
// TestService::Stub is returned by Get() everytime it is called
ServiceStub(ChannelCreationFunc channel_creation_func,
bool new_stub_every_call);

@ -151,11 +151,11 @@ void RunServer(const std::set<int>& grpc_ports, const std::set<int>& xds_ports,
int main(int argc, char** argv) {
// Preprocess argv, for two things:
// 1. merge duplciate flags. So "--grpc=8080 --grpc=9090" becomes
// 1. merge duplicate flags. So "--grpc=8080 --grpc=9090" becomes
// "--grpc=8080,9090".
// 2. replace '-' to '_'. So "--istio-version=123" becomes
// "--istio_version=123".
// 3. remove --version since that is specially interpretted by absl
// 3. remove --version since that is specially interpreted by absl
std::map<std::string, std::vector<std::string>> argv_dict;
for (int i = 0; i < argc; i++) {
std::string arg(argv[i]);

@ -32,7 +32,7 @@
int kDeadlineSecs = 10;
ABSL_FLAG(std::string, metrics_server_address, "localhost:8081",
"The metrics server addresses in the fomrat <hostname>:<port>");
"The metrics server addresses in the format <hostname>:<port>");
// TODO(Capstan): Consider using absl::Duration
ABSL_FLAG(int32_t, deadline_secs, kDeadlineSecs,
"The deadline (in seconds) for RCP call");

@ -100,7 +100,7 @@ void BM_EventEngine_RunClosure(benchmark::State& state) {
int cb_count = state.range(0);
grpc_core::Notification* signal = new grpc_core::Notification();
std::atomic_int count{0};
// Ignore leaks from this closure. For simplicty, this closure is not deleted
// Ignore leaks from this closure. For simplicity, this closure is not deleted
// because the closure may still be executing after the EventEngine is
// destroyed. This is because the default posix EventEngine's thread pool may
// get destroyed separately from the EventEngine.

@ -42,7 +42,7 @@ static void* tag(intptr_t x) { return reinterpret_cast<void*>(x); }
// Repeatedly makes Streaming Bidi calls (exchanging a configurable number of
// messages in each call) in a loop on a single channel
//
// First parmeter (i.e state.range(0)): Message size (in bytes) to use
// First parameter (i.e state.range(0)): Message size (in bytes) to use
// Second parameter (i.e state.range(1)): Number of ping pong messages.
// Note: One ping-pong means two messages (one from client to server and
// the other from server to client):
@ -138,7 +138,7 @@ static void BM_StreamingPingPong(benchmark::State& state) {
}
// Repeatedly sends ping pong messages in a single streaming Bidi call in a loop
// First parmeter (i.e state.range(0)): Message size (in bytes) to use
// First parameter (i.e state.range(0)): Message size (in bytes) to use
template <class Fixture, class ClientContextMutator, class ServerContextMutator>
static void BM_StreamingPingPongMsgs(benchmark::State& state) {
const int msg_size = state.range(0);
@ -229,7 +229,7 @@ static void BM_StreamingPingPongMsgs(benchmark::State& state) {
// sendmsg syscalls for streaming by coalescing 1. initial metadata with first
// message; 2. final streaming message with trailing metadata.
//
// First parmeter (i.e state.range(0)): Message size (in bytes) to use
// First parameter (i.e state.range(0)): Message size (in bytes) to use
// Second parameter (i.e state.range(1)): Number of ping pong messages.
// Note: One ping-pong means two messages (one from client to server and
// the other from server to client):

@ -92,7 +92,7 @@ def wait_until_dns_server_is_up(args,
dns_server_subprocess.kill()
dns_server_subprocess.wait()
test_runner_log(('Failed to reach DNS server over TCP and/or UDP. '
'Exitting without running tests.'))
'Exiting without running tests.'))
test_runner_log('======= DNS server stdout '
'(merged stdout and stderr) =============')
with open(dns_server_subprocess_output, 'r') as l:

@ -112,7 +112,7 @@ int main(int argc, char** argv) {
test_srcdir.value() +
absl::GetFlag(FLAGS_grpc_test_directory_relative_to_test_srcdir) +
std::string("/test/cpp/naming");
// Invoke bazel's executeable links to the .sh and .py scripts (don't use
// Invoke bazel's executable links to the .sh and .py scripts (don't use
// the .sh and .py suffixes) to make
// sure that we're using bazel's test environment.
result = grpc::testing::InvokeResolverComponentTestsRunner(

@ -154,7 +154,7 @@ def flush_stdout_loop():
sys.stdout.flush()
time.sleep(sleep_time)
num_timeouts_so_far += 1
print("Process timeout reached, or cancelled. Exitting 0.")
print("Process timeout reached, or cancelled. Exiting 0.")
os.kill(os.getpid(), signal.SIGTERM)

@ -86,7 +86,7 @@ def wait_until_dns_server_is_up(args):
test_runner_log(
(
"Failed to reach DNS server over TCP and/or UDP. "
"Exitting without running tests."
"Exiting without running tests."
)
)
sys.exit(1)

@ -103,8 +103,9 @@ ConstructPerWorkerCredentialTypesMap() {
}
size_t comma = next_entry.find(',');
if (comma == std::string::npos) {
LOG(ERROR) << "Expectd --per_worker_credential_types to be a list of the "
"form: 'addr1,cred_type1;addr2,cred_type2;...' into.";
LOG(ERROR)
<< "Expected --per_worker_credential_types to be a list of the "
"form: 'addr1,cred_type1;addr2,cred_type2;...' into.";
abort();
}
std::string addr = next_entry.substr(0, comma);

@ -132,7 +132,7 @@ TEST_F(LoadDataStoreTest, ReassignOrphanStores) {
auto assigned_to_lb_id_4 =
load_data_store.GetAssignedStores(kHostname2, kLbId4);
// There is no active LB for the first host now. kLbId4 is active but
// it's for the second host, so it wll NOT adopt the orphaned stores.
// it's for the second host, so it will NOT adopt the orphaned stores.
EXPECT_FALSE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_4,
kHostname1, kLbId1, kLoadKey1));
EXPECT_FALSE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_4,
@ -187,16 +187,16 @@ TEST_F(LoadDataStoreTest, OrphanAssignmentIsSticky) {
// Close the assigned_lb_id, orphaned_lb_id will be re-assigned again.
load_data_store.ReportStreamClosed(kHostname1, assigned_lb_id);
active_lb_ids.erase(assigned_lb_id);
size_t orphaned_lb_id_occurences = 0;
size_t orphaned_lb_id_occurrences = 0;
for (const auto& lb_id : active_lb_ids) {
if (PerBalancerStoresContains(
load_data_store,
load_data_store.GetAssignedStores(kHostname1, lb_id), kHostname1,
orphaned_lb_id, kLoadKey1)) {
orphaned_lb_id_occurences++;
orphaned_lb_id_occurrences++;
}
}
EXPECT_EQ(orphaned_lb_id_occurences, 1U);
EXPECT_EQ(orphaned_lb_id_occurrences, 1U);
}
TEST_F(LoadDataStoreTest, HostTemporarilyLoseAllStreams) {

@ -80,7 +80,7 @@ class CliCall final {
void WritesDoneAndWait();
// Thread-safe Read. Blockingly receive a generic response message. Notify
// writes if they are finished when this read is waiting for a resposne.
// writes if they are finished when this read is waiting for a response.
bool ReadAndMaybeNotifyWrite(
std::string* response,
IncomingMetadataContainer* server_initial_metadata);
@ -97,7 +97,7 @@ class CliCall final {
grpc::CompletionQueue cq_;
gpr_mu write_mu_;
gpr_cv write_cv_; // Protected by write_mu_;
bool write_done_; // Portected by write_mu_;
bool write_done_; // Protected by write_mu_;
};
} // namespace testing

@ -19,7 +19,7 @@ cd /d %~dp0\..\..\..
@rem is on PATH. To avoid picking up the older version protoc.exe, we change the path to something non-existent.
set PATH=%PATH:ProtoC=DontPickupProtoC%
@rem Install into ./testinstall, but use absolute path and foward slashes
@rem Install into ./testinstall, but use absolute path and forward slashes
set INSTALL_DIR=%cd:\=/%/testinstall
@rem Download OpenSSL-Win32 originally installed from https://slproweb.com/products/Win32OpenSSL.html

@ -19,7 +19,7 @@ cd /d %~dp0\..\..\..
@rem is on PATH. To avoid picking up the older version protoc.exe, we change the path to something non-existent.
set PATH=%PATH:ProtoC=DontPickupProtoC%
@rem Install into ./testinstall, but use absolute path and foward slashes
@rem Install into ./testinstall, but use absolute path and forward slashes
set INSTALL_DIR=%cd:\=/%/testinstall
@rem Download OpenSSL-Win32 originally installed from https://slproweb.com/products/Win32OpenSSL.html

Loading…
Cancel
Save