170 Commits

Author SHA1 Message Date
Jordan Rupprecht 41780cddd1 Avoid multimap::find unspecified behavior (#41279)
When a `std::multimap` has multiple entries with the same key, calling `m.find(key)` returns an unspecified element.

Historically, this returns the first matching element. However, this is not guaranteed, and recent libc++ changes make this return an arbitrary element.

Using `m.equal_range(key)` is a replacement that will preserve the current behavior. The behavior of this is guaranteed to return a range of all matching elements in insertion order, and the beginning of the range is the same element as what's normally returned by `m.find(key)`.

Closes #41279

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/41279 from rupprecht:multimap-find 70b116441d03eff80523e010b25336f5a75c70c2
PiperOrigin-RevId: 852844558
2026-01-06 10:44:32 -08:00
Craig Tiller 339906443b [clang-format] Match include file ordering to internal clang-format (#40905)
gRPC is currently getting formatted with two different clang-format implementations, and due to some weirdness they have different include file orderings. This change introduces clang-format configuration to ensure that the two systems align - it's *highly* expected that this will need some maintenance going forward as the two systems evolve.

Closes #40905

PiperOrigin-RevId: 819606209
2025-10-15 00:24:11 -07:00
Adam Heller f5ffef4d6b [test] Add PostMortem dumps on CHECK failures in test builds (#39945)
See `grpc_check.h`. This code  redefines the abseil `CHECK*` macros using custom gRPC macros when building tests. In `bazel test ...` builds, on check failure, `PostMortemEmit()` will dump state to the log before crashing.

Caveat: to prevent circular dependencies, code that `postmortem` relies on cannot use the custom gRPC CHECK macros. This is not much code, ~50 source files. grep for the `absl/log:check` bazel dependency.

Closes #39945

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39945 from drfloob:grpc_check ca8e46718f2021e0df79aa67a3a0b0c751b3ce44
PiperOrigin-RevId: 807452496
2025-09-15 17:43:19 -07:00
Craig Tiller 2e10452ffb Split CoreConfiguration builders into two buckets: ephemeral and persistent.
We use builders for a variety of tasks - sometimes for testing, sometimes for adapting gRPC to novel environments, sometimes for once off special tasks early in a process lifetime.

Treating these as the same thing has started leading to some problems, so here I introduce a reset-proof registration for a subset of these tasks.

I'll be using this to register chaotic-good into the EndpointTransport registry so that it doesn't need to join the usual core configuration chain (and accidentally pull in protobuf to core).

PiperOrigin-RevId: 750048742
2025-04-21 22:38:04 -07:00
Pawan Bhardwaj d590875bc3 [Cleanup] Avoid std::make_tuple (#38643)
C++17 : Template argument deduction for class templates

Closes #38643

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38643 from pawbhard:cleanup-tuple dcd211ff5b824d2854c4de5e26e96d61619fa1b3
PiperOrigin-RevId: 721806200
2025-01-31 09:53:08 -08:00
AJ Heller 478b4c0fba [C++17] Replace absl::optional with std::optional (#38420)
Closes #38420

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38420 from drfloob:cpp17-optional 7f276aaa3c493a2ea7f4f1766da975e083914a5b
PiperOrigin-RevId: 715081837
2025-01-13 13:13:38 -08:00
Mark D. Roth 7570d8b545 [reorg] move src/core/lib/config -> src/core/config (#37847)
Closes #37847

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37847 from markdroth:reorg_config 191c5460bc2b9c974bf76a3eedc876963d296f47
PiperOrigin-RevId: 698957093
2024-11-22 05:46:04 +00:00
Craig Tiller dbb5164ac7 [clang-format] Remove custom clang-format rules for include ordering (#37820)
Closes #37820

PiperOrigin-RevId: 682352913
2024-10-04 09:44:20 -07:00
Mark D. Roth f6c57b6384 [reorg] move a bunch of stuff to src/core/util (#36792)
The following files have been moved:
- src/core/lib/avl/*
- src/core/lib/backoff/*
- src/core/lib/debug/event_log*
- src/core/lib/iomgr/gethostname*
- src/core/lib/iomgr/grpc_if_nametoindex*
- src/core/lib/matchers/*
- src/core/lib/uri/* (renamed from uri_parser.* to uri.*)
- src/core/lib/gprpp/* (existing src/core/util/time.cc was renamed to gpr_time.cc to avoid conflict)

Closes #36792

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36792 from markdroth:reorg_util d4e8996f481c611ffbb06a8b04924ff81bc1bc2b
PiperOrigin-RevId: 676947640
2024-09-20 13:19:02 -07:00
Tanvi Jagtap 7091890ae7 [Gpr_To_Absl_Logging] [Gpr_To_Absl_Logging] Minor log formatting fixes
PiperOrigin-RevId: 648665041
2024-07-02 04:05:42 -07:00
Tanvi Jagtap d148728588 Use LOG_IF(FATAL, ...) instead of gpr_assertion_failed() in interop_client.cc
gpr_assertion_failed() will be deprecated soon.

LOG_IF(FATAL, condition) will terminate if condition is true.

PiperOrigin-RevId: 636770885
2024-05-23 20:48:30 -07:00
Tanvi Jagtap 7cc547dfd9 [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log (#36526)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log

In this CL we are migrating from gRPCs own gpr logging mechanism to absl logging mechanism. The intention is to deprecate gpr_log in the future.

We have the following mapping
1. gpr_log(GPR_INFO,...) -> LOG(INFO)
2. gpr_log(GPR_ERROR,...) -> LOG(ERROR)
3. gpr_log(GPR_DEBUG,...) -> VLOG(2)

Reviewers need to check :
1. If the above mapping is correct.
2. The content of the log is as before.

gpr_log format strings did not use string_view or std::string . absl LOG accepts these. So there will be some elimination of string_view and std::string related conversions. This is expected.

Closes #36526

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36526 from tanvi-jagtap:test_large_interop_client_gpr_log 46a657fe203be59a5e8ad87c0dbfd9c52ba2f1f6
PiperOrigin-RevId: 630993244
2024-05-06 03:50:34 -07:00
Mark D. Roth 0944410d6c [reorg] move test/core/util -> test/core/test_util (#36446)
Closes #36446

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36446 from markdroth:reorg_test 5dcc85e006581a8fc52a3a914baa5f33e4a21589
PiperOrigin-RevId: 629229220
2024-04-29 17:06:40 -07:00
Tanvi Jagtap 30386413c0 [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36438)
[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 #36438

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36438 from tanvi-jagtap:tjagtap_cpp 405efd63c33aaef551368578c06d01eb85e2a629
PiperOrigin-RevId: 628281347
2024-04-25 21:03:38 -07:00
Tanvi Jagtap 259f0e7903 [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - GPR_ASSERT (#36222)
Replacing GPR_ASSERT with absl CHECK

Will not be replacing CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites.

This could be done using Cider-V once these changes are submitted if we want to clean up later. Given that we have 4000+ 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 #36222

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36222 from tanvi-jagtap:assert_interop adcc660e78c74cc1f8257d9925b9ed1215dab4a8
PiperOrigin-RevId: 623366969
2024-04-09 21:32:34 -07:00
Alexander Polcyn 1abd28eb3b Log c++ interop "soak" results at INFO instead of DEBUG
PiperOrigin-RevId: 620955008
2024-04-01 14:34:25 -07:00
Eugene Ostroukhov e73b76a7da [Test] Fix bug in waiting for the Orca OOB report (#35467)
Make sure there is no unnecessary delays when there are multiple reports in the queue.

This change also adds a test for the custom LB policy.

Closes #35467

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35467 from eugeneo:tasks/orca-test-timeout-316026521 4aab50a1187586ce1375bc85231b70091ef9d3e2
PiperOrigin-RevId: 597007131
2024-01-09 12:21:45 -08:00
Mohan Li 66f60aa763 [test] Allow set request/response size in interop soak test (#34010)
Internal bug: b/289109827
2023-08-10 09:34:27 -07:00
Eugene Ostroukhov 0980076bb9 [interop] fix C++ server to add mutex for orca_oob test (#33278)
Following improvements were made to `orca_oob` interop test to increase
compatibility and stability:

1. Timeout was increased to 10s (see #33098)
2. Server will block clients trying to run this test concurrently.
3. Data is cleared in the beginning of the call.
2023-05-31 20:07:51 -07:00
Eugene Ostroukhov 65fa0f605a [testing] Update orca-* tests for better compatibility (#32630)
1. Make channel creation lazy. This allows test cases to update the
configuration before the connection is made.
2. Pass load reports tracker when creating the policy. This way other
test cases do not see any changes to ChannelArguments.

Using grpc_core::CoreConfiguration::RunWithSpecialConfiguration was
considered but did not work as it removes other builders setup prior to
starting the test cases.
2023-03-16 12:54:59 -07:00
Eugene Ostroukhov a70fd8e5e2 [testing] Synchronize interop test protos. (#32631)
Fixes: issue #32628
2023-03-16 12:37:54 -07:00
Eugene Ostroukhov acec3a6975 [testing]: Add "orca_oob" test case (#32599) 2023-03-15 08:24:36 -07:00
Eugene Ostroukhov c62ecd5cb4 [testing]: Add "orca_per_rpc" test case (#32524) 2023-03-14 11:06:31 -07:00
Craig Tiller 67f364e23e [cleanup] Eliminate usage of GRPC_ASSERT(false...); (#31757)
* crash function

* progress

* fix

* fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fixes

* Automated change: Fix sanity tests

* fix

* Automated change: Fix sanity tests

* fix

* fix

* use cpp attr

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* fix

* fix

* add exclusion

* fix

* typo

* fix

* fmt

* Update tcp_socket_utils.cc

* Automated change: Fix sanity tests

* fix

* revert php changes

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-01-11 08:50:32 -08:00
apolcyn c952d37814 [testing] add test client for use in XDS federation tests (#32020)
[testing] add test client for use in XDS federation tests
2023-01-05 14:14:47 -08:00
Yijie Ma f99b8b5bc4 Convert c-style comments to C++-style comments (#31923)
* baseline

* fix clang-tidy

* manually revert these files

* manually fixup at eof

* revert 2 more files

* change check_deprecated_grpc++.py

* change end2end_defs.include template

* fix check_include_guards.py

* untrack tools/distrib/python/convert_cstyle_comments_to_cpp.py

not yet ready to be submitted

* fix

yapf check_include_guards.py
remove a space...

* fix version.cc.template

* fix version_info.h.template
2022-12-22 23:01:53 -08:00
Esun Kim f3fedae7c8 Added readability-redundant-string-cstr (#31707)
* Added readability-redundant-string-cstr

* Auto fix

* No need to wrap std::string
2022-11-18 17:12:46 -08:00
apolcyn a1e1d34f36 Log peer address in interop soak client (#30006) 2022-06-14 10:55:55 -07:00
apolcyn 61b34dfaee Improve logging in interop soak test and add a flag to limit QPS (#29357)
* Improve logging in interop soak test and add a flag to limit QPS
2022-04-08 21:16:23 -07:00
Craig Tiller fe913387da Remove idempotent/cacheable requests (#28922)
* Remove idempotent/cacheable requests

* more cleanup

* bump core version

* fix

* fix

* fix

* review feedback

* fixes

* fix

* remove more

* objc

* fix

* fix

* fix

* scrub

* Modify XdsRbacTests

Co-authored-by: Yash Tibrewal <yashkt@google.com>
2022-03-04 14:42:59 -08:00
Craig Tiller ea389c00c2 Adjust include order per style guide (#27175)
Introduce clang-format configuration to sort includes closer to our rules.
2021-09-08 12:14:44 -07:00
apolcyn d742153b32 Include the peer address in interop soak test high-latency error messages (#26932) 2021-08-10 09:47:16 -07:00
Esun Kim a41a206b8c Fix readability-const-return-type,readability-delete-null-pointer,readability-simplify-boolean-expr (#25628) 2021-03-09 21:30:35 -08:00
Esun Kim 377fe6095a Upgrade clang-tidy and clang-format to 11 (#25590)
* Upgrade clang-tidy and clang-format to 11
* Reformat code
* Fix abseil-string-find-str-contains
* Fix modernize-make-unique
2021-03-04 11:54:30 -08:00
Mark D. Roth 27e1c1c56d clang-tidy: enable google-readability-braces-around-statements 2020-11-06 13:41:44 -08:00
Yash Tibrewal d10e06b60a Add interop test for special_status_message 2020-09-17 14:00:47 -07:00
Mark D. Roth 9404f66f70 Replace most uses of gpr_asprintf() with absl calls. 2020-07-07 12:01:02 -07:00
Esun Kim 165ee5007a Replaced grpc::string with std::string 2020-06-29 17:56:36 -07:00
Alexander Polcyn 5727ccc28f Rename deadline/timeout 2020-06-10 23:25:29 -07:00
Alexander Polcyn 46c13cd870 Add a flag to interop soak tests to exit early and fail if X seconds have passed and we're not done yet. 2020-06-08 18:40:11 -07:00
Alexander Polcyn 1dad16c0d9 Use C-core's histogram, drop use of exec_ctx header 2020-05-08 15:54:38 -07:00
Alexander Polcyn b872ffe2f2 Make channel soak interop test more debuggable, add max_failures and
max_acceptable_latency_ms options
2020-05-07 11:41:16 -07:00
Yash Tibrewal 331b332392 Try fixing interop tests 2020-04-10 16:43:30 -07:00
Vijay Pai 406b70629a Remove unused parameter warning (17 of 20) 2019-10-17 08:52:00 -07:00
Qixuan Li 6a89c0e57e Add more logging to channel_soak interop test to indicate the boundary of an iteration 2019-10-15 21:46:45 +00:00
Qixuan Li 913acf456b fix minor nits 2019-06-26 22:32:33 +00:00
Qixuan Li 0e85762b67 add pick_first_unary 2019-06-26 13:49:36 -07:00
Alexander Polcyn a4e9f33b85 Add interop cloud to prod test for GoogleDefaultCredentials 2018-12-07 17:19:17 -08:00
Vijay Pai a192fc6880 Fix clang-tidy issues 2018-11-11 14:32:55 -08:00
Adele Zhou 165417e4fa Change the test name to long_lived_channel 2018-09-12 14:30:02 -07:00