[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36441)

[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK

These changes have been made using string replacement and regex.

Will not be replacing all instances of CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites. Only ones which are doable using very simple regex with least chance of failure will be replaced.

Given that we have 5000+ instances of GPR_ASSERT to edit, Doing it manually is too much work for both the author and reviewer.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #36441

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36441 from tanvi-jagtap:tjagtap_util_01 ca10292925
PiperOrigin-RevId: 627961969
pull/36445/head^2
Tanvi Jagtap 9 months ago committed by Copybara-Service
parent 4fdd2a8786
commit b0de95507c
  1. 64
      CMakeLists.txt
  2. 64
      build_autogenerated.yaml
  3. 4
      test/cpp/util/BUILD
  4. 13
      test/cpp/util/channelz_sampler.cc
  5. 9
      test/cpp/util/channelz_sampler_test.cc
  6. 18
      test/cpp/util/cli_call.cc
  7. 9
      test/cpp/util/create_test_channel.cc
  8. 3
      test/cpp/util/test_credentials_provider.cc
  9. 1
      test/cpp/util/windows/BUILD
  10. 3
      test/cpp/util/windows/manifest_file.cc

64
CMakeLists.txt generated

@ -4793,6 +4793,7 @@ target_include_directories(grpc++_test_util
)
target_link_libraries(grpc++_test_util
${_gRPC_ALLTARGETS_LIBRARIES}
absl::check
grpc++
grpc_test_util
)
@ -7114,7 +7115,6 @@ target_include_directories(async_end2end_test
target_link_libraries(async_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -8152,7 +8152,6 @@ target_include_directories(binder_server_test
target_link_libraries(binder_server_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -9044,7 +9043,6 @@ target_include_directories(cancel_ares_query_test
target_link_libraries(cancel_ares_query_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_config
grpc++_test_util
)
@ -9659,7 +9657,6 @@ target_include_directories(cfstream_test
target_link_libraries(cfstream_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -10077,7 +10074,6 @@ target_include_directories(channelz_service_test
target_link_libraries(channelz_service_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpcpp_channelz
grpc++_test_util
)
@ -10496,7 +10492,6 @@ target_include_directories(client_callback_end2end_test
target_link_libraries(client_callback_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -10752,7 +10747,6 @@ target_include_directories(client_interceptors_end2end_test
target_link_libraries(client_interceptors_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -10825,7 +10819,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(client_lb_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -11623,7 +11616,6 @@ target_include_directories(context_allocator_end2end_test
target_link_libraries(context_allocator_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -11843,7 +11835,6 @@ target_include_directories(crl_provider_test
target_link_libraries(crl_provider_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -12056,7 +12047,6 @@ target_include_directories(delegating_channel_test
target_link_libraries(delegating_channel_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -12592,7 +12582,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
target_link_libraries(end2end_binder_transport_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -12658,7 +12647,6 @@ target_include_directories(end2end_test
target_link_libraries(end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
absl::check
grpc++_test
grpc++_test_util
)
@ -14216,7 +14204,6 @@ target_include_directories(flaky_network_test
target_link_libraries(flaky_network_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -15250,7 +15237,6 @@ target_include_directories(grpc_authz_end2end_test
target_link_libraries(grpc_authz_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc_authorization_provider
grpc++_test_util
)
@ -15406,6 +15392,7 @@ target_include_directories(grpc_cli
target_link_libraries(grpc_cli
${_gRPC_ALLTARGETS_LIBRARIES}
absl::check
grpc++
${_gRPC_PROTOBUF_PROTOC_LIBRARIES}
grpc++_test_config
@ -16196,7 +16183,6 @@ target_include_directories(grpclb_api_test
target_link_libraries(grpclb_api_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -16266,7 +16252,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(grpclb_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_config
grpc++_test_util
)
@ -16654,7 +16639,6 @@ target_include_directories(health_service_end2end_test
target_link_libraries(health_service_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -17079,7 +17063,6 @@ target_include_directories(http2_client
target_link_libraries(http2_client
${_gRPC_ALLTARGETS_LIBRARIES}
absl::check
grpc++_test_config
grpc++_test_util
)
@ -17387,7 +17370,6 @@ target_include_directories(hybrid_end2end_test
target_link_libraries(hybrid_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -18221,7 +18203,6 @@ target_include_directories(interop_client
target_link_libraries(interop_client
${_gRPC_ALLTARGETS_LIBRARIES}
absl::check
grpc++_test_config
grpc++_test_util
)
@ -18276,7 +18257,6 @@ target_include_directories(interop_server
target_link_libraries(interop_server
${_gRPC_ALLTARGETS_LIBRARIES}
absl::check
grpc++_test_config
grpc++_test_util
)
@ -19895,7 +19875,6 @@ target_include_directories(message_allocator_end2end_test
target_link_libraries(message_allocator_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -20696,7 +20675,6 @@ target_include_directories(nonblocking_test
target_link_libraries(nonblocking_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -21068,7 +21046,6 @@ target_include_directories(otel_plugin_test
target_link_libraries(otel_plugin_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
opentelemetry-cpp::api
opentelemetry-cpp::metrics
grpc++_test_util
@ -22163,7 +22140,6 @@ target_include_directories(port_sharing_end2end_test
target_link_libraries(port_sharing_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -22356,7 +22332,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
target_link_libraries(posix_event_engine_native_dns_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -22412,7 +22387,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
target_link_libraries(posix_event_engine_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -22911,7 +22885,6 @@ target_include_directories(proto_server_reflection_test
target_link_libraries(proto_server_reflection_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_reflection
grpc++_test_util
)
@ -23100,7 +23073,6 @@ target_include_directories(qps_json_driver
target_link_libraries(qps_json_driver
${_gRPC_ALLTARGETS_LIBRARIES}
absl::check
grpc++_test_config
grpc++_test_util
)
@ -23173,7 +23145,6 @@ target_include_directories(qps_worker
target_link_libraries(qps_worker
${_gRPC_ALLTARGETS_LIBRARIES}
absl::check
grpc++_test_config
grpc++_test_util
)
@ -23358,7 +23329,6 @@ target_include_directories(raw_end2end_test
target_link_libraries(raw_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -26532,7 +26502,6 @@ target_include_directories(rls_end2end_test
target_link_libraries(rls_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_config
grpc++_test_util
)
@ -26965,7 +26934,6 @@ target_include_directories(server_builder_plugin_test
target_link_libraries(server_builder_plugin_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -27461,7 +27429,6 @@ target_include_directories(server_interceptors_end2end_test
target_link_libraries(server_interceptors_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -27793,7 +27760,6 @@ target_include_directories(service_config_end2end_test
target_link_libraries(service_config_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -28079,7 +28045,6 @@ target_include_directories(shutdown_test
target_link_libraries(shutdown_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -30623,7 +30588,6 @@ target_include_directories(test_cpp_end2end_ssl_credentials_test
target_link_libraries(test_cpp_end2end_ssl_credentials_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -31492,7 +31456,6 @@ target_include_directories(tls_credentials_test
target_link_libraries(tls_credentials_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -31552,7 +31515,6 @@ target_include_directories(tls_key_export_test
target_link_libraries(tls_key_export_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -31649,7 +31611,6 @@ target_include_directories(too_many_pings_test
target_link_libraries(too_many_pings_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_config
grpc++_test_util
)
@ -33303,6 +33264,7 @@ target_include_directories(xds_audit_logger_registry_test
target_link_libraries(xds_audit_logger_registry_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++
${_gRPC_PROTOBUF_PROTOC_LIBRARIES}
grpc_test_util
@ -33621,7 +33583,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_cluster_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -33917,7 +33878,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_cluster_type_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -34003,6 +33963,7 @@ target_include_directories(xds_common_types_test
target_link_libraries(xds_common_types_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++
${_gRPC_PROTOBUF_PROTOC_LIBRARIES}
grpc_test_util
@ -34179,7 +34140,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_core_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -34241,7 +34201,6 @@ target_include_directories(xds_credentials_end2end_test
target_link_libraries(xds_credentials_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -34475,7 +34434,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_csds_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -34671,7 +34629,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_config
grpc++_test_util
)
@ -34911,7 +34868,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_fallback_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -35094,7 +35050,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_fault_injection_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -35228,6 +35183,7 @@ target_include_directories(xds_http_filters_test
target_link_libraries(xds_http_filters_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++
${_gRPC_PROTOBUF_PROTOC_LIBRARIES}
grpc_test_util
@ -35346,6 +35302,7 @@ target_include_directories(xds_lb_policy_registry_test
target_link_libraries(xds_lb_policy_registry_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++
${_gRPC_PROTOBUF_PROTOC_LIBRARIES}
grpc_test_util
@ -35488,6 +35445,7 @@ target_include_directories(xds_listener_resource_type_test
target_link_libraries(xds_listener_resource_type_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++
${_gRPC_PROTOBUF_PROTOC_LIBRARIES}
grpc_test_util
@ -35671,7 +35629,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_outlier_detection_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -35858,7 +35815,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_override_host_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -36134,7 +36090,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_pick_first_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -36314,7 +36269,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_ring_hash_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -36498,7 +36452,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_rls_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -36620,6 +36573,7 @@ target_include_directories(xds_route_config_resource_type_test
target_link_libraries(xds_route_config_resource_type_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++
${_gRPC_PROTOBUF_PROTOC_LIBRARIES}
grpc_test_util
@ -36803,7 +36757,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_routing_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)
@ -37066,7 +37019,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_wrr_end2end_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)

@ -4052,6 +4052,7 @@ libs:
- test/cpp/util/subprocess.cc
- test/cpp/util/test_credentials_provider.cc
deps:
- absl/log:check
- grpc++
- grpc_test_util
- name: grpc++_unsecure
@ -5643,7 +5644,6 @@ targets:
- test/cpp/end2end/async_end2end_test.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: auth_context_test
gtest: true
@ -6134,7 +6134,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: binder_transport_test
gtest: true
@ -6899,7 +6898,6 @@ targets:
- test/cpp/naming/cancel_ares_query_test.cc
deps:
- gtest
- absl/log:check
- grpc++_test_config
- grpc++_test_util
- name: cancel_before_invoke_test
@ -7488,7 +7486,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: channel_args_test
gtest: true
@ -7618,7 +7615,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpcpp_channelz
- grpc++_test_util
- name: check_gcp_environment_linux_test
@ -7888,7 +7884,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: client_channel_service_config_test
gtest: true
@ -7960,7 +7955,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: client_lb_end2end_test
gtest: true
@ -7985,7 +7979,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -8404,7 +8397,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: context_test
gtest: true
@ -8469,7 +8461,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: crl_ssl_transport_security_test
gtest: true
@ -8577,7 +8568,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: destroy_grpclb_channel_with_active_connect_stress_test
gtest: true
@ -8823,7 +8813,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -8846,7 +8835,6 @@ targets:
- test/cpp/end2end/interceptors_util.cc
- test/cpp/end2end/test_service_impl.cc
deps:
- absl/log:check
- grpc++_test
- grpc++_test_util
- name: endpoint_addresses_test
@ -9822,7 +9810,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: flow_control_test
gtest: true
@ -10480,7 +10467,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc_authorization_provider
- grpc++_test_util
- name: grpc_authz_test
@ -10580,6 +10566,7 @@ targets:
- test/cpp/util/proto_reflection_descriptor_database.cc
- test/cpp/util/service_describer.cc
deps:
- absl/log:check
- grpc++
- protoc
- grpc++_test_config
@ -10894,7 +10881,6 @@ targets:
- test/cpp/grpclb/grpclb_api_test.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: grpclb_end2end_test
gtest: true
@ -10915,7 +10901,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_config
- grpc++_test_util
platforms:
@ -11056,7 +11041,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: high_initial_seqno_test
gtest: true
@ -11333,7 +11317,6 @@ targets:
- src/proto/grpc/testing/test.proto
- test/cpp/interop/http2_client.cc
deps:
- absl/log:check
- grpc++_test_config
- grpc++_test_util
- name: http2_settings_test
@ -11474,7 +11457,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: idle_filter_state_test
gtest: true
@ -12389,7 +12371,6 @@ targets:
- test/cpp/interop/client_helper.cc
- test/cpp/interop/interop_client.cc
deps:
- absl/log:check
- grpc++_test_config
- grpc++_test_util
- name: interop_server
@ -12407,7 +12388,6 @@ targets:
- test/cpp/interop/interop_server_bootstrap.cc
- test/cpp/interop/server_helper.cc
deps:
- absl/log:check
- grpc++_test_config
- grpc++_test_util
- name: invalid_call_argument_test
@ -13412,7 +13392,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: message_compress_test
gtest: true
@ -13824,7 +13803,6 @@ targets:
- test/cpp/end2end/nonblocking_test.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: notification_test
gtest: true
@ -13967,7 +13945,6 @@ targets:
- test/cpp/ext/otel/otel_test_library.cc
deps:
- gtest
- absl/log:check
- opentelemetry-cpp::api
- opentelemetry-cpp::metrics
- grpc++_test_util
@ -14571,7 +14548,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: posix_endpoint_test
gtest: true
@ -14653,7 +14629,6 @@ targets:
- test/cpp/util/windows/manifest_file.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -14687,7 +14662,6 @@ targets:
- test/cpp/util/windows/manifest_file.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -14878,7 +14852,6 @@ targets:
- test/cpp/util/proto_reflection_descriptor_database.cc
deps:
- gtest
- absl/log:check
- grpc++_reflection
- grpc++_test_util
- name: proto_utils_test
@ -14997,7 +14970,6 @@ targets:
- test/cpp/qps/server_sync.cc
- test/cpp/qps/usage_timer.cc
deps:
- absl/log:check
- grpc++_test_config
- grpc++_test_util
- name: qps_worker
@ -15031,7 +15003,6 @@ targets:
- test/cpp/qps/usage_timer.cc
- test/cpp/qps/worker.cc
deps:
- absl/log:check
- grpc++_test_config
- grpc++_test_util
- name: query_extensions_test
@ -15091,7 +15062,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: rbac_service_config_parser_test
gtest: true
@ -17831,7 +17801,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_config
- grpc++_test_util
- name: rls_lb_config_parser_test
@ -17996,7 +17965,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: server_builder_test
gtest: true
@ -18213,7 +18181,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: server_registered_method_bad_client_test
gtest: true
@ -18375,7 +18342,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: service_config_test
gtest: true
@ -18560,7 +18526,6 @@ targets:
- test/cpp/end2end/shutdown_test.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: simple_delayed_request_test
gtest: true
@ -19781,7 +19746,6 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: test_cpp_ext_chaotic_good_test
gtest: true
@ -20127,7 +20091,6 @@ targets:
- test/cpp/end2end/tls_credentials_test.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: tls_key_export_test
gtest: true
@ -20142,7 +20105,6 @@ targets:
- test/cpp/end2end/tls_key_export_test.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: tls_security_connector_test
gtest: true
@ -20187,7 +20149,6 @@ targets:
- test/core/transport/chttp2/too_many_pings_test.cc
deps:
- gtest
- absl/log:check
- grpc++_test_config
- grpc++_test_util
- name: traced_buffer_list_test
@ -21131,6 +21092,7 @@ targets:
- test/cpp/util/service_describer.cc
deps:
- gtest
- absl/log:check
- grpc++
- protoc
- grpc_test_util
@ -21235,7 +21197,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -21328,7 +21289,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -21363,6 +21323,7 @@ targets:
- test/cpp/util/service_describer.cc
deps:
- gtest
- absl/log:check
- grpc++
- protoc
- grpc_test_util
@ -21422,7 +21383,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -21443,7 +21403,6 @@ targets:
- test/cpp/end2end/xds/xds_credentials_end2end_test.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: xds_credentials_test
gtest: true
@ -21530,7 +21489,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -21596,7 +21554,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_config
- grpc++_test_util
platforms:
@ -21674,7 +21631,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -21734,7 +21690,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -21782,6 +21737,7 @@ targets:
- test/cpp/util/service_describer.cc
deps:
- gtest
- absl/log:check
- grpc++
- protoc
- grpc_test_util
@ -21824,6 +21780,7 @@ targets:
- test/cpp/util/service_describer.cc
deps:
- gtest
- absl/log:check
- grpc++
- protoc
- grpc_test_util
@ -21871,6 +21828,7 @@ targets:
- test/cpp/util/service_describer.cc
deps:
- gtest
- absl/log:check
- grpc++
- protoc
- grpc_test_util
@ -21929,7 +21887,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -21990,7 +21947,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -22082,7 +22038,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -22143,7 +22098,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -22205,7 +22159,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -22250,6 +22203,7 @@ targets:
- test/cpp/util/service_describer.cc
deps:
- gtest
- absl/log:check
- grpc++
- protoc
- grpc_test_util
@ -22308,7 +22262,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux
@ -22398,7 +22351,6 @@ targets:
- test/cpp/util/tls_test_utils.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
platforms:
- linux

@ -77,6 +77,7 @@ grpc_cc_library(
],
external_deps = [
"absl/flags:flag",
"absl/log:check",
"protobuf",
],
deps = [
@ -139,6 +140,7 @@ grpc_cc_library(
],
external_deps = [
"absl/flags:flag",
"absl/log:check",
"protobuf",
"protobuf_clib",
],
@ -335,6 +337,7 @@ grpc_cc_binary(
srcs = ["channelz_sampler.cc"],
external_deps = [
"absl/flags:flag",
"absl/log:check",
"absl/strings",
],
language = "c++",
@ -360,6 +363,7 @@ grpc_cc_test(
":channelz_sampler",
],
external_deps = [
"absl/log:check",
"gtest",
],
flaky = True,

@ -27,6 +27,7 @@
#include <string>
#include "absl/flags/flag.h"
#include "absl/log/check.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "google/protobuf/text_format.h"
@ -134,7 +135,7 @@ class ChannelzSampler final {
if (!status.ok()) {
gpr_log(GPR_ERROR, "GetChannelRPC failed: %s",
get_channel_context.debug_error_string().c_str());
GPR_ASSERT(0);
CHECK(0);
}
return get_channel_response.channel();
}
@ -153,7 +154,7 @@ class ChannelzSampler final {
if (!status.ok()) {
gpr_log(GPR_ERROR, "GetSubchannelRPC failed: %s",
get_subchannel_context.debug_error_string().c_str());
GPR_ASSERT(0);
CHECK(0);
}
return get_subchannel_response.subchannel();
}
@ -171,7 +172,7 @@ class ChannelzSampler final {
if (!status.ok()) {
gpr_log(GPR_ERROR, "GetSocketRPC failed: %s",
get_socket_context.debug_error_string().c_str());
GPR_ASSERT(0);
CHECK(0);
}
return get_socket_response.socket();
}
@ -300,7 +301,7 @@ class ChannelzSampler final {
"Wrong user credential type: %s. Allowed credential types: "
"INSECURE_CREDENTIALS, ssl, alts, google_default_credentials.",
custom_credentials_type.c_str());
GPR_ASSERT(0);
CHECK(0);
}
std::shared_ptr<grpc::Channel> channel =
CreateChannel(server_address, channel_creds);
@ -333,7 +334,7 @@ class ChannelzSampler final {
static_cast<int>(server_start_id),
get_servers_context.debug_error_string().c_str());
}
GPR_ASSERT(0);
CHECK(0);
}
for (const auto& _server : get_servers_response.server()) {
all_servers_.push_back(_server);
@ -388,7 +389,7 @@ class ChannelzSampler final {
"GetTopChannelsRequest.channel_start_id=%d failed: %s",
static_cast<int>(channel_start_id),
get_top_channels_context.debug_error_string().c_str());
GPR_ASSERT(0);
CHECK(0);
}
for (const auto& _topchannel : get_top_channels_response.channel()) {
top_channels_.push_back(_topchannel);

@ -24,6 +24,7 @@
#include <string>
#include <thread>
#include "absl/log/check.h"
#include "absl/strings/str_cat.h"
#include "gtest/gtest.h"
@ -96,7 +97,7 @@ void RunClient(const std::string& client_id, gpr_event* done_ev) {
Status status = stub->EmptyCall(&context, request, &response);
if (!status.ok()) {
gpr_log(GPR_ERROR, "Client echo failed.");
GPR_ASSERT(0);
CHECK(0);
}
}
}
@ -146,17 +147,17 @@ TEST(ChannelzSamplerTest, SimpleTest) {
gpr_log(GPR_ERROR,
"Channelz sampler test test-runner exited with code %d",
WEXITSTATUS(status));
GPR_ASSERT(0); // log the line number of the assertion failure
CHECK(0); // log the line number of the assertion failure
}
} else if (WIFSIGNALED(status)) {
gpr_log(GPR_ERROR, "Channelz sampler test test-runner ended from signal %d",
WTERMSIG(status));
GPR_ASSERT(0);
CHECK(0);
} else {
gpr_log(GPR_ERROR,
"Channelz sampler test test-runner ended with unknown status %d",
status);
GPR_ASSERT(0);
CHECK(0);
}
delete test_driver;
gpr_event_set(&done_ev1, reinterpret_cast<void*>(1));

@ -22,6 +22,8 @@
#include <iostream>
#include <utility>
#include "absl/log/check.h"
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
@ -81,7 +83,7 @@ CliCall::CliCall(const std::shared_ptr<grpc::Channel>& channel,
void* got_tag;
bool ok;
cq_.Next(&got_tag, &ok);
GPR_ASSERT(ok);
CHECK(ok);
}
CliCall::~CliCall() {
@ -98,7 +100,7 @@ void CliCall::Write(const std::string& request) {
grpc::ByteBuffer send_buffer(&req_slice, 1);
call_->Write(send_buffer, tag(2));
cq_.Next(&got_tag, &ok);
GPR_ASSERT(ok);
CHECK(ok);
}
bool CliCall::Read(std::string* response,
@ -113,7 +115,7 @@ bool CliCall::Read(std::string* response,
return false;
}
std::vector<grpc::Slice> slices;
GPR_ASSERT(recv_buffer.Dump(&slices).ok());
CHECK(recv_buffer.Dump(&slices).ok());
response->clear();
for (size_t i = 0; i < slices.size(); i++) {
@ -132,7 +134,7 @@ void CliCall::WritesDone() {
call_->WritesDone(tag(4));
cq_.Next(&got_tag, &ok);
GPR_ASSERT(ok);
CHECK(ok);
}
void CliCall::WriteAndWait(const std::string& request) {
@ -175,7 +177,7 @@ bool CliCall::ReadAndMaybeNotifyWrite(
cq_result = cq_.Next(&got_tag, &ok);
if (got_tag == tag(2)) {
GPR_ASSERT(ok);
CHECK(ok);
}
}
@ -186,7 +188,7 @@ bool CliCall::ReadAndMaybeNotifyWrite(
gpr_mu_lock(&write_mu_);
if (!write_done_) {
cq_.Next(&got_tag, &ok);
GPR_ASSERT(got_tag != tag(2));
CHECK(got_tag != tag(2));
write_done_ = true;
gpr_cv_signal(&write_cv_);
}
@ -196,7 +198,7 @@ bool CliCall::ReadAndMaybeNotifyWrite(
}
std::vector<grpc::Slice> slices;
GPR_ASSERT(recv_buffer.Dump(&slices).ok());
CHECK(recv_buffer.Dump(&slices).ok());
response->clear();
for (size_t i = 0; i < slices.size(); i++) {
response->append(reinterpret_cast<const char*>(slices[i].begin()),
@ -215,7 +217,7 @@ Status CliCall::Finish(IncomingMetadataContainer* server_trailing_metadata) {
call_->Finish(&status, tag(5));
cq_.Next(&got_tag, &ok);
GPR_ASSERT(ok);
CHECK(ok);
if (server_trailing_metadata) {
*server_trailing_metadata = ctx_.GetServerTrailingMetadata();
}

@ -19,6 +19,7 @@
#include "test/cpp/util/create_test_channel.h"
#include "absl/flags/flag.h"
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpcpp/create_channel.h>
@ -135,7 +136,7 @@ std::shared_ptr<Channel> CreateTestChannel(
std::shared_ptr<ChannelCredentials> channel_creds =
testing::GetCredentialsProvider()->GetChannelCredentials(credential_type,
&channel_args);
GPR_ASSERT(channel_creds != nullptr);
CHECK_NE(channel_creds, nullptr);
if (creds.get()) {
channel_creds = grpc::CompositeChannelCredentials(channel_creds, creds);
}
@ -174,7 +175,7 @@ std::shared_ptr<Channel> CreateTestChannel(
channel_creds = testing::GetCredentialsProvider()->GetChannelCredentials(
testing::kTlsCredentialsType, &channel_args);
}
GPR_ASSERT(channel_creds != nullptr);
CHECK_NE(channel_creds, nullptr);
const std::string& connect_to = server.empty() ? override_hostname : server;
if (creds.get()) {
@ -190,7 +191,7 @@ std::shared_ptr<Channel> CreateTestChannel(
} else {
channel_creds = testing::GetCredentialsProvider()->GetChannelCredentials(
cred_type, &channel_args);
GPR_ASSERT(channel_creds != nullptr);
CHECK_NE(channel_creds, nullptr);
if (interceptor_creators.empty()) {
return grpc::CreateCustomChannel(server, channel_creds, channel_args);
@ -252,7 +253,7 @@ std::shared_ptr<Channel> CreateTestChannel(
std::shared_ptr<ChannelCredentials> channel_creds =
testing::GetCredentialsProvider()->GetChannelCredentials(credential_type,
&channel_args);
GPR_ASSERT(channel_creds != nullptr);
CHECK_NE(channel_creds, nullptr);
if (creds.get()) {
channel_creds = grpc::CompositeChannelCredentials(channel_creds, creds);
}

@ -26,6 +26,7 @@
#include <unordered_map>
#include "absl/flags/flag.h"
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
@ -176,7 +177,7 @@ CredentialsProvider* GetCredentialsProvider() {
void SetCredentialsProvider(CredentialsProvider* provider) {
// For now, forbids overriding provider.
GPR_ASSERT(g_provider == nullptr);
CHECK_EQ(g_provider, nullptr);
g_provider = provider;
}

@ -31,6 +31,7 @@ grpc_cc_library(
"manifest_file.h",
],
external_deps = [
"absl/log:check",
"absl/strings",
],
deps = [

@ -24,6 +24,7 @@
#include <string>
#include <vector>
#include "absl/log/check.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
@ -57,7 +58,7 @@ std::string ManifestFile::Get(const std::string& key) {
std::getline(filestream_, line);
if (!line.empty()) {
std::vector<std::string> kv = absl::StrSplit(line, " ");
GPR_ASSERT(kv.size() == 2);
CHECK_EQ(kv.size(), 2u);
cache_.emplace(kv[0], kv[1]);
if (kv[0] == key) {
return kv[1];

Loading…
Cancel
Save