[CI] Upgraded clang to 18 in sanity tests (#37593)

Closes #37593

PiperOrigin-RevId: 668971470
pull/37603/head
Esun Kim 3 months ago committed by Copybara-Service
parent a374ef377d
commit be26969058
  1. 9
      .clang-tidy
  2. 6
      include/grpc/support/sync_generic.h
  3. 2
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.h
  4. 2
      src/core/lib/event_engine/cf_engine/cftype_unique_ref.h
  5. 4
      src/core/lib/event_engine/posix_engine/posix_engine_listener.h
  6. 2
      src/core/lib/event_engine/posix_engine/tcp_socket_utils.h
  7. 2
      src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc
  8. 6
      src/core/lib/promise/interceptor_list.h
  9. 2
      src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
  10. 2
      src/core/util/latent_see.h
  11. 2
      src/core/util/ring_buffer.h
  12. 3
      src/core/util/spinlock.h
  13. 3
      src/objective-c/manual_tests/GrpcIosTestUITests/GrpcIosTestUITests.m
  14. 2
      templates/tools/dockerfile/grpc_clang_format/Dockerfile.template
  15. 2
      templates/tools/dockerfile/grpc_clang_tidy/Dockerfile.template
  16. 10
      templates/tools/dockerfile/test/sanity/Dockerfile.template
  17. 68
      test/core/end2end/end2end_test_suites.cc
  18. 6
      test/core/end2end/h2_ssl_cert_test.cc
  19. 2
      test/core/event_engine/default_engine_methods_test.cc
  20. 2
      test/core/event_engine/posix/posix_engine_test_utils.h
  21. 3
      test/core/gprpp/match_test.cc
  22. 6
      test/core/iomgr/pollset_windows_starvation_test.cc
  23. 3
      test/core/promise/bm_party.cc
  24. 8
      test/core/promise/if_test.cc
  25. 44
      test/core/transport/chttp2/ping_callbacks_test.cc
  26. 6
      test/cpp/cocoapods/generic/generic.mm
  27. 2
      test/cpp/qps/interarrival.h
  28. 2
      test/cpp/qps/server_async.cc
  29. 2
      test/cpp/server/server_builder_with_socket_mutator_test.cc
  30. 2
      tools/bazelify_tests/dockerimage_current_versions.bzl
  31. 2
      tools/dockerfile/grpc_clang_format/Dockerfile
  32. 2
      tools/dockerfile/grpc_clang_tidy/Dockerfile
  33. 2
      tools/dockerfile/test/sanity.current_version
  34. 10
      tools/dockerfile/test/sanity/Dockerfile

@ -69,31 +69,37 @@ Checks: '-*,
bugprone-*,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-casting-through-void,
-bugprone-easily-swappable-parameters,
-bugprone-empty-catch,
-bugprone-exception-escape,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-inc-dec-in-conditions,
-bugprone-infinite-loop,
-bugprone-multi-level-implicit-pointer-conversion,
-bugprone-narrowing-conversions,
-bugprone-not-null-terminated-result,
-bugprone-optional-value-conversion,
-bugprone-reserved-identifier,
-bugprone-signed-char-misuse,
-bugprone-sizeof-expression,
-bugprone-switch-missing-default-case,
-bugprone-too-small-loop-variable,
-bugprone-unchecked-optional-access,
-bugprone-unused-local-non-trivial-variable,
-bugprone-unused-return-value,
google-*,
-google-readability-casting,
-google-runtime-int,
-google-runtime-references,
performance-*,
-performance-avoid-endl,
-performance-enum-size,
-performance-no-automatic-move,
-performance-no-int-to-ptr,
-performance-noexcept-swap,
-performance-unnecessary-copy-initialization,
-performance-unnecessary-value-param,
clang-diagnostic-deprecated-declarations,
clang-diagnostic-deprecated-register,
clang-diagnostic-expansion-to-defined,
clang-diagnostic-ignored-attributes,
@ -102,6 +108,7 @@ Checks: '-*,
clang-diagnostic-shift-sign-overflow,
clang-diagnostic-tautological-undefined-compare,
clang-diagnostic-thread-safety*,
-clang-diagnostic-thread-safety-reference-return,
clang-diagnostic-undefined-bool-conversion,
clang-diagnostic-unreachable-code,
clang-diagnostic-unreachable-code-loop-increment,

@ -29,8 +29,7 @@ typedef struct {
gpr_atm state;
} gpr_event;
#define GPR_EVENT_INIT \
{ 0 }
#define GPR_EVENT_INIT {0}
/* gpr_refcount */
typedef struct {
@ -42,7 +41,6 @@ typedef struct {
gpr_atm value;
} gpr_stats_counter;
#define GPR_STATS_INIT \
{ 0 }
#define GPR_STATS_INIT {0}
#endif /* GRPC_SUPPORT_SYNC_GENERIC_H */

@ -83,7 +83,7 @@ class ChaoticGoodServerListener final : public Server::ListenerInterface {
class HandshakingState : public RefCounted<HandshakingState> {
public:
explicit HandshakingState(RefCountedPtr<ActiveConnection> connection);
~HandshakingState() override{};
~HandshakingState() override {};
void Start(std::unique_ptr<
grpc_event_engine::experimental::EventEngine::Endpoint>
endpoint);

@ -37,7 +37,7 @@ class CFTypeUniqueRef {
CFTypeUniqueRef(CFTypeUniqueRef const&) = delete;
CFTypeUniqueRef& operator=(CFTypeUniqueRef const&) = delete;
CFTypeUniqueRef(CFTypeUniqueRef&& other) : cf_type_ref_(other.release()){};
CFTypeUniqueRef(CFTypeUniqueRef&& other) : cf_type_ref_(other.release()) {};
CFTypeUniqueRef& operator=(CFTypeUniqueRef&& other) {
reset(other.release());
return *this;

@ -93,7 +93,7 @@ class PosixEngineListenerImpl
ResolvedAddressToNormalizedString(socket_.addr),
listener_->poller_->CanTrackErrors())),
notify_on_accept_(PosixEngineClosure::ToPermanentClosure(
[this](absl::Status status) { NotifyOnAccept(status); })){};
[this](absl::Status status) { NotifyOnAccept(status); })) {};
// Start listening for incoming connections on the socket.
void Start();
// Internal callback invoked when the socket has incoming connections to
@ -129,7 +129,7 @@ class PosixEngineListenerImpl
class ListenerAsyncAcceptors : public ListenerSocketsContainer {
public:
explicit ListenerAsyncAcceptors(PosixEngineListenerImpl* listener)
: listener_(listener){};
: listener_(listener) {};
void UpdateOnAppendCallback(
PosixListenerWithFdSupport::OnPosixBindNewFdCallback on_append) {

@ -163,7 +163,7 @@ class PosixSocketWrapper {
public:
explicit PosixSocketWrapper(int fd) : fd_(fd) { CHECK_GT(fd_, 0); }
PosixSocketWrapper() : fd_(-1){};
PosixSocketWrapper() : fd_(-1) {};
~PosixSocketWrapper() = default;

@ -82,7 +82,7 @@ grpc_slice FlattenIovec(const struct iovec* iov, int iov_count) {
// instantiated at the top of the virtual socket function callstack.
class WSAErrorContext {
public:
explicit WSAErrorContext(){};
explicit WSAErrorContext() {};
~WSAErrorContext() {
if (error_ != 0) {

@ -217,15 +217,13 @@ class InterceptorList {
// Append a new map to the end of the chain.
template <typename Fn>
void AppendMap(Fn fn, DebugLocation from) {
Append(MakeMapToAdd(
std::move(fn), [] {}, from));
Append(MakeMapToAdd(std::move(fn), [] {}, from));
}
// Prepend a new map to the beginning of the chain.
template <typename Fn>
void PrependMap(Fn fn, DebugLocation from) {
Prepend(MakeMapToAdd(
std::move(fn), [] {}, from));
Prepend(MakeMapToAdd(std::move(fn), [] {}, from));
}
// Append a new map to the end of the chain, with a cleanup function to be

@ -72,7 +72,7 @@ namespace {
// instantiated at the top of the virtual socket function callstack.
class WSAErrorContext final {
public:
explicit WSAErrorContext(){};
explicit WSAErrorContext() {};
~WSAErrorContext() {
if (error_ != 0) {

@ -156,7 +156,7 @@ class Log {
static std::atomic<uintptr_t> free_bins_;
absl::AnyInvocable<void(absl::string_view)> stats_flusher_ = nullptr;
struct Fragment {
Fragment() : active(&primary){};
Fragment() : active(&primary) {};
Mutex mu;
RingBuffer<RecordedEvent, Log::kMaxEventsPerCpu>* active
ABSL_GUARDED_BY(mu);

@ -64,7 +64,7 @@ class RingBuffer {
T operator*() { return buffer_->data_[head_]; }
RingBufferIterator() : buffer_(nullptr), head_(0), size_(0){};
RingBufferIterator() : buffer_(nullptr), head_(0), size_(0) {};
RingBufferIterator(const RingBufferIterator& other) = default;
explicit RingBufferIterator(const RingBuffer<T, kCapacity>* buffer)
: buffer_(buffer), head_(buffer->head_), size_(buffer->size_) {

@ -34,8 +34,7 @@ struct gpr_spinlock {
#else
#define GPR_SPINLOCK_INITIALIZER ((gpr_spinlock){0})
#endif
#define GPR_SPINLOCK_STATIC_INITIALIZER \
{ 0 }
#define GPR_SPINLOCK_STATIC_INITIALIZER {0}
#define gpr_spinlock_trylock(lock) (gpr_atm_acq_cas(&(lock)->atm, 0, 1))
#define gpr_spinlock_unlock(lock) (gpr_atm_rel_store(&(lock)->atm, 0))

@ -75,8 +75,7 @@ int const kNumIterations = 1;
[NSThread sleepForTimeInterval:1];
}
// Wait until all events in run loop have been processed
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, true) == kCFRunLoopRunHandledSource)
;
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, true) == kCFRunLoopRunHandledSource);
NSLog(@"Pressing button: %@", name);
[testApp.buttons[name] tap];

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM silkeh/clang:17-bookworm
FROM silkeh/clang:18-bookworm
ADD clang_format_all_the_things.sh /

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM silkeh/clang:17-bookworm
FROM silkeh/clang:18-bookworm
# Install prerequisites for the clang-tidy script
RUN apt-get update && apt-get install -y python3 jq git && apt-get clean

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM silkeh/clang:17-bookworm
FROM silkeh/clang:18-bookworm
<%include file="../../apt_get_basic.include"/>
@ -22,13 +22,13 @@
# (Bullseye comes with Python 3.9 which isn't supported by pytype yet)
RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev ${'\\'}
libnss3-dev libssl-dev libreadline-dev libffi-dev libbz2-dev
RUN curl -O https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tar.xz && ${'\\'}
tar -xf Python-3.7.9.tar.xz && ${'\\'}
cd Python-3.7.9 && ${'\\'}
RUN curl -O https://www.python.org/ftp/python/3.7.17/Python-3.7.17.tar.xz && ${'\\'}
tar -xf Python-3.7.17.tar.xz && ${'\\'}
cd Python-3.7.17 && ${'\\'}
./configure && ${'\\'}
make -j 4 && ${'\\'}
make install
RUN curl https://bootstrap.pypa.io/get-pip.py | python3
RUN curl https://bootstrap.pypa.io/pip/3.7/get-pip.py | python3
<%include file="../../gcp_api_libraries.include"/>
<%include file="../../run_tests_addons.include"/>

@ -585,7 +585,7 @@ std::string GetTempDir() {
const std::string temp_dir = GetTempDir();
std::vector<CoreTestConfiguration> DefaultConfigs() {
return std::vector<CoreTestConfiguration> {
return std::vector<CoreTestConfiguration>{
#ifdef GRPC_POSIX_SOCKET
CoreTestConfiguration{"Chttp2Fd",
FEATURE_MASK_IS_HTTP2 | FEATURE_MASK_DO_NOT_FUZZ |
@ -606,16 +606,14 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
}},
CoreTestConfiguration{
"Chttp2Fullstack",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_IS_HTTP2,
nullptr,
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_IS_HTTP2, nullptr,
[](const ChannelArgs& /*client_args*/,
const ChannelArgs& /*server_args*/) {
return std::make_unique<InsecureFixture>();
}},
CoreTestConfiguration{
"Chttp2FullstackCompression",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_IS_HTTP2,
nullptr,
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_IS_HTTP2, nullptr,
[](const ChannelArgs&, const ChannelArgs&) {
return std::make_unique<CompressionFixture>();
}},
@ -677,12 +675,12 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
const ChannelArgs& /*server_args*/) {
gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
return std::make_unique<LocalTestFixture>(
absl::StrFormat(
"unix:%s"
"grpc_fullstack_test.%%25.%d.%" PRId64 ".%" PRId32
".%" PRId64 ".%" PRId64,
absl::StrFormat("unix:%s"
"grpc_fullstack_test.%%25.%d.%" PRId64
".%" PRId32 ".%" PRId64 ".%" PRId64,
temp_dir, getpid(), now.tv_sec, now.tv_nsec,
unique.fetch_add(1, std::memory_order_relaxed), Rand()),
unique.fetch_add(1, std::memory_order_relaxed),
Rand()),
UDS);
}},
CoreTestConfiguration{
@ -696,12 +694,12 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
const ChannelArgs& /*server_args*/) {
gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
return std::make_unique<LocalTestFixture>(
absl::StrFormat(
"unix:%s"
"grpc_fullstack_test.%d.%" PRId64 ".%" PRId32 ".%" PRId64
".%" PRId64,
absl::StrFormat("unix:%s"
"grpc_fullstack_test.%d.%" PRId64 ".%" PRId32
".%" PRId64 ".%" PRId64,
temp_dir, getpid(), now.tv_sec, now.tv_nsec,
unique.fetch_add(1, std::memory_order_relaxed), Rand()),
unique.fetch_add(1, std::memory_order_relaxed),
Rand()),
UDS);
}},
#endif
@ -716,8 +714,7 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
}},
CoreTestConfiguration{
"Chttp2FullstackWithCensus",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_IS_HTTP2,
nullptr,
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_IS_HTTP2, nullptr,
[](const ChannelArgs&, const ChannelArgs&) {
return std::make_unique<CensusFixture>();
}},
@ -746,15 +743,13 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
FEATURE_MASK_IS_HTTP2 | FEATURE_MASK_DO_NOT_FUZZ,
"foo.test.google.fr",
[](const ChannelArgs& client_args, const ChannelArgs& server_args) {
return std::make_unique<SslProxyFixture>(client_args,
server_args);
return std::make_unique<SslProxyFixture>(client_args, server_args);
}},
CoreTestConfiguration{
"Chttp2InsecureCredentials",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS_LEVEL_INSECURE |
FEATURE_MASK_IS_HTTP2 |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS,
FEATURE_MASK_IS_HTTP2 | FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS,
nullptr,
[](const ChannelArgs&, const ChannelArgs&) {
return std::make_unique<InsecureCredsFixture>();
@ -762,8 +757,7 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
},
CoreTestConfiguration{
"Chttp2SimpleSslWithOauth2FullstackTls12",
FEATURE_MASK_IS_SECURE |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_SECURE | FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_IS_HTTP2 |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS,
"foo.test.google.fr",
@ -772,8 +766,7 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
}},
CoreTestConfiguration{
"Chttp2SimpleSslWithOauth2FullstackTls13",
FEATURE_MASK_IS_SECURE |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_SECURE | FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_IS_HTTP2,
"foo.test.google.fr",
[](const ChannelArgs&, const ChannelArgs&) {
@ -781,8 +774,7 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
}},
CoreTestConfiguration{
"Chttp2SimplSslFullstackTls12",
FEATURE_MASK_IS_SECURE |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_SECURE | FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_IS_HTTP2 |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS,
"foo.test.google.fr",
@ -791,8 +783,7 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
}},
CoreTestConfiguration{
"Chttp2SimplSslFullstackTls13",
FEATURE_MASK_IS_SECURE |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_SECURE | FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_DOES_NOT_SUPPORT_CLIENT_HANDSHAKE_COMPLETE_FIRST |
FEATURE_MASK_IS_HTTP2,
@ -800,13 +791,13 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
[](const ChannelArgs&, const ChannelArgs&) {
return std::make_unique<SslTlsFixture>(grpc_tls_version::TLS1_3);
}},
CoreTestConfiguration{
"Chttp2SocketPair",
CoreTestConfiguration{"Chttp2SocketPair",
FEATURE_MASK_IS_HTTP2 | FEATURE_MASK_DO_NOT_FUZZ |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS,
nullptr,
[](const ChannelArgs&, const ChannelArgs&) {
return std::make_unique<SockpairFixture>(ChannelArgs());
return std::make_unique<SockpairFixture>(
ChannelArgs());
}},
CoreTestConfiguration{
"Chttp2SocketPair1ByteAtATime",
@ -827,8 +818,7 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
FEATURE_MASK_DO_NOT_FUZZ,
nullptr,
[](const ChannelArgs&, const ChannelArgs&) {
return std::make_unique<SockpairWithMinstackFixture>(
ChannelArgs());
return std::make_unique<SockpairWithMinstackFixture>(ChannelArgs());
}},
CoreTestConfiguration{
"Inproc",
@ -849,8 +839,7 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
},
CoreTestConfiguration{
"Chttp2SslCredReloadTls12",
FEATURE_MASK_IS_SECURE |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_SECURE | FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_IS_HTTP2 |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS,
"foo.test.google.fr",
@ -994,8 +983,7 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
return std::make_unique<InsecureFixtureWithPipeForWakeupFd>();
}},
#endif
CoreTestConfiguration {
"ChaoticGoodFullStack",
CoreTestConfiguration{"ChaoticGoodFullStack",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_DOES_NOT_SUPPORT_RETRY |
FEATURE_MASK_DOES_NOT_SUPPORT_WRITE_BUFFERING |
@ -1004,9 +992,7 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
[](const ChannelArgs& /*client_args*/,
const ChannelArgs& /*server_args*/) {
return std::make_unique<ChaoticGoodFixture>();
}
}
};
}}};
}
std::vector<CoreTestConfiguration> AllConfigs() {

@ -141,13 +141,11 @@ class TestFixture : public SecureFixture {
typedef enum { SUCCESS, FAIL } test_result;
#define SSL_TEST(request_type, cert_type, result) \
{ \
{TEST_NAME(request_type, cert_type, result), \
{{TEST_NAME(request_type, cert_type, result), \
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL, \
"foo.test.google.fr", TestFixture::MakeFactory(request_type, cert_type)}, \
result \
}
result}
// All test configurations
struct CoreTestConfigWrapper {

@ -69,7 +69,7 @@ class DefaultEngineTest : public testing::Test {
const DNSResolver::ResolverOptions& /* options */) override {
return nullptr;
};
void Run(Closure* /* closure */) override{};
void Run(Closure* /* closure */) override {};
void Run(absl::AnyInvocable<void()> /* closure */) override{};
TaskHandle RunAfter(Duration /* when */, Closure* /* closure */) override {
return {-1, -1};

@ -30,7 +30,7 @@ class TestScheduler : public Scheduler {
public:
explicit TestScheduler(grpc_event_engine::experimental::EventEngine* engine)
: engine_(engine) {}
TestScheduler() : engine_(nullptr){};
TestScheduler() : engine_(nullptr) {};
void ChangeCurrentEventEngine(
grpc_event_engine::experimental::EventEngine* engine) {
engine_ = engine;

@ -54,8 +54,7 @@ TEST(MatchTest, TestVoidReturn) {
TEST(MatchTest, TestMutable) {
absl::variant<int, double> v = 1.9;
MatchMutable(
&v, [](int*) { abort(); }, [](double* x) { *x = 0.0; });
MatchMutable(&v, [](int*) { abort(); }, [](double* x) { *x = 0.0; });
EXPECT_EQ(v, (absl::variant<int, double>(0.0)));
}

@ -112,8 +112,7 @@ int main(int argc, char** argv) {
gpr_mu_lock(&params.mu);
while (
params.queuing != THREADS &&
!gpr_cv_wait(&params.cv, &params.mu, gpr_inf_future(GPR_CLOCK_REALTIME)))
;
!gpr_cv_wait(&params.cv, &params.mu, gpr_inf_future(GPR_CLOCK_REALTIME)));
gpr_mu_unlock(&params.mu);
// Wait for the mutexes to be released. This indicates that the threads have
@ -133,8 +132,7 @@ int main(int argc, char** argv) {
gpr_mu_lock(&params.mu);
while (
params.complete != THREADS &&
!gpr_cv_wait(&params.cv, &params.mu, gpr_inf_future(GPR_CLOCK_REALTIME)))
;
!gpr_cv_wait(&params.cv, &params.mu, gpr_inf_future(GPR_CLOCK_REALTIME)));
gpr_mu_unlock(&params.mu);
for (auto& t : threads) t.Join();

@ -34,8 +34,7 @@ BENCHMARK(BM_PartyCreate);
void BM_AddParticipant(benchmark::State& state) {
auto party = Party::Make(SimpleArenaAllocator()->MakeArena());
for (auto _ : state) {
party->Spawn(
"participant", []() { return Success{}; }, [](StatusFlag) {});
party->Spawn("participant", []() { return Success{}; }, [](StatusFlag) {});
}
}
BENCHMARK(BM_AddParticipant);

@ -51,15 +51,11 @@ TEST(IfTest, ChooseFailure) {
}
TEST(IfTest, ImmediateChooseTrue) {
EXPECT_EQ(If(
true, []() { return 1; }, []() { return 2; })(),
Poll<int>(1));
EXPECT_EQ(If(true, []() { return 1; }, []() { return 2; })(), Poll<int>(1));
}
TEST(IfTest, ImmediateChooseFalse) {
EXPECT_EQ(If(
false, []() { return 1; }, []() { return 2; })(),
Poll<int>(2));
EXPECT_EQ(If(false, []() { return 1; }, []() { return 2; })(), Poll<int>(2));
}
} // namespace grpc_core

@ -118,9 +118,7 @@ TEST(PingCallbacksTest, PingRoundtrips) {
// request
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 456};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 456}; });
auto id = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });
@ -198,9 +196,7 @@ TEST(PingCallbacksTest, DuplicatePingIdFlagsError) {
EXPECT_FALSE(acked);
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 456};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 456}; });
auto id = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });
@ -240,9 +236,7 @@ TEST(PingCallbacksTest, OnPingAckCanPiggybackInflightPings) {
EXPECT_FALSE(acked_second);
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 456};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 456}; });
auto id = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });
@ -281,9 +275,7 @@ TEST(PingCallbacksTest, PingAckRoundtrips) {
EXPECT_FALSE(acked);
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 456};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 456}; });
auto id = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });
@ -321,9 +313,7 @@ TEST(PingCallbacksTest, MultiPingRoundtrips) {
EXPECT_FALSE(acked2);
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 456};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 456}; });
auto id1 = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });
@ -348,9 +338,7 @@ TEST(PingCallbacksTest, MultiPingRoundtrips) {
EXPECT_FALSE(acked2);
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 789};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 789}; });
auto id2 = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });
@ -402,9 +390,7 @@ TEST(PingCallbacksTest, MultiPingRoundtripsWithOutOfOrderAcks) {
EXPECT_FALSE(acked2);
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 456};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 456}; });
auto id1 = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });
@ -429,9 +415,7 @@ TEST(PingCallbacksTest, MultiPingRoundtripsWithOutOfOrderAcks) {
EXPECT_FALSE(acked2);
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 789};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 789}; });
auto id2 = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });
@ -492,9 +476,7 @@ TEST(PingCallbacksTest, CoalescedPingsRoundtrip) {
EXPECT_FALSE(acked2);
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 456};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 456}; });
auto id = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });
@ -537,9 +519,7 @@ TEST(PingCallbacksTest, CancelAllCancelsCallbacks) {
// Can still send a ping, no callback should be invoked
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 456};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 456}; });
auto id = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });
@ -574,9 +554,7 @@ TEST(PingCallbacksTest, CancelAllCancelsInflightPings) {
EXPECT_FALSE(acked);
EXPECT_CALL(event_engine, RunAfter(EventEngine::Duration(Duration::Hours(24)),
Matcher<absl::AnyInvocable<void()>>(_)))
.WillOnce([]() {
return EventEngine::TaskHandle{123, 456};
});
.WillOnce([]() { return EventEngine::TaskHandle{123, 456}; });
auto id = callbacks.StartPing(bitgen);
callbacks.OnPingTimeout(Duration::Hours(24), &event_engine,
[] { Crash("should not reach here"); });

@ -146,10 +146,8 @@ int byte_buffer_eq_string(ByteBuffer* bb, const char* str) {
bool ignored_ok;
cli_cq_.Shutdown();
srv_cq_->Shutdown();
while (cli_cq_.Next(&ignored_tag, &ignored_ok))
;
while (srv_cq_->Next(&ignored_tag, &ignored_ok))
;
while (cli_cq_.Next(&ignored_tag, &ignored_ok));
while (srv_cq_->Next(&ignored_tag, &ignored_ok));
[super tearDown];
}

@ -87,7 +87,7 @@ class InterarrivalTimer {
thread_posns_.push_back(random_table_.begin() + (entries * i) / threads);
}
}
virtual ~InterarrivalTimer(){};
virtual ~InterarrivalTimer() {};
int64_t next(int thread_num) {
auto ret = *(thread_posns_[thread_num]++);

@ -238,7 +238,7 @@ class AsyncQpsServerTest final : public grpc::testing::Server {
ServerRpcContext() {}
void lock() { mu_.lock(); }
void unlock() { mu_.unlock(); }
virtual ~ServerRpcContext(){};
virtual ~ServerRpcContext() {};
virtual bool RunNextState(bool) = 0; // next state, return false if done
virtual void Reset() = 0; // start this back at a clean state
private:

@ -84,7 +84,7 @@ class MockSocketMutatorServerBuilderOption : public grpc::ServerBuilderOption {
}
void UpdatePlugins(
std::vector<std::unique_ptr<ServerBuilderPlugin>>*) override{};
std::vector<std::unique_ptr<ServerBuilderPlugin>>*) override {};
MockSocketMutator* mock_socket_mutator_;
};

@ -113,5 +113,5 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"tools/dockerfile/test/rbe_ubuntu2004.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:b3eb1a17b7b091e3c5648a803076b2c40601242ff91c04d55997af6641305f68",
"tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:d2e79919b2e2d4cc36a29682ecb5170641df4fb506cfb453978ffdeb8a841bd9",
"tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:6e8b4696ba0661f11a31ed0992a94d2efcd889a018f57160f0e2fb62963f3593",
"tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:966aa97475368b6fc308a7e9e584ab471e8c6a47b4a6c9e709c0b1b7d4e2d800",
"tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:4fb77e7130e10934e65ec0657e286a8ca5850e9a25441dabe2174b3cb6a56180",
}

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM silkeh/clang:17-bookworm
FROM silkeh/clang:18-bookworm
ADD clang_format_all_the_things.sh /

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM silkeh/clang:17-bookworm
FROM silkeh/clang:18-bookworm
# Install prerequisites for the clang-tidy script
RUN apt-get update && apt-get install -y python3 jq git && apt-get clean

@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/sanity:f21b7692698957bebcd72e8ab5d24c485cb4cbaf@sha256:966aa97475368b6fc308a7e9e584ab471e8c6a47b4a6c9e709c0b1b7d4e2d800
us-docker.pkg.dev/grpc-testing/testing-images-public/sanity:0006a2ed3aca736f842b3e1bf758cb6ab621922d@sha256:4fb77e7130e10934e65ec0657e286a8ca5850e9a25441dabe2174b3cb6a56180

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM silkeh/clang:17-bookworm
FROM silkeh/clang:18-bookworm
#=================
# Basic C core dependencies
@ -67,13 +67,13 @@ RUN git config --global protocol.file.allow always
# (Bullseye comes with Python 3.9 which isn't supported by pytype yet)
RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
libnss3-dev libssl-dev libreadline-dev libffi-dev libbz2-dev
RUN curl -O https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tar.xz && \
tar -xf Python-3.7.9.tar.xz && \
cd Python-3.7.9 && \
RUN curl -O https://www.python.org/ftp/python/3.7.17/Python-3.7.17.tar.xz && \
tar -xf Python-3.7.17.tar.xz && \
cd Python-3.7.17 && \
./configure && \
make -j 4 && \
make install
RUN curl https://bootstrap.pypa.io/get-pip.py | python3
RUN curl https://bootstrap.pypa.io/pip/3.7/get-pip.py | python3
# Google Cloud Platform API libraries
# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)

Loading…
Cancel
Save