diff --git a/test/core/end2end/end2end_test_corpus/clusterfuzz-testcase-minimized-core_end2end_test_fuzzer-4592933739233280 b/test/core/end2end/end2end_test_corpus/clusterfuzz-testcase-minimized-core_end2end_test_fuzzer-4592933739233280 new file mode 100644 index 00000000000..57a46062488 --- /dev/null +++ b/test/core/end2end/end2end_test_corpus/clusterfuzz-testcase-minimized-core_end2end_test_fuzzer-4592933739233280 @@ -0,0 +1,7 @@ +test_id: 3405774848 +event_engine_actions { + run_delay: 0 + run_delay: 6399 + run_delay: 4294967296 + run_delay: 4294967296 +} diff --git a/test/core/end2end/end2end_tests.cc b/test/core/end2end/end2end_tests.cc index bd46be8566a..4bf745225d5 100644 --- a/test/core/end2end/end2end_tests.cc +++ b/test/core/end2end/end2end_tests.cc @@ -84,6 +84,13 @@ void CoreEnd2endTest::SetUp() { void CoreEnd2endTest::TearDown() { const bool do_shutdown = fixture_ != nullptr; + std::shared_ptr ee; +// TODO(hork): locate the windows leak so we can enable end2end experiments. +#ifndef GPR_WINDOWS + if (grpc_is_initialized()) { + ee = grpc_event_engine::experimental::GetDefaultEventEngine(); + } +#endif ShutdownAndDestroyClient(); ShutdownAndDestroyServer(); cq_verifier_.reset(); @@ -98,15 +105,11 @@ void CoreEnd2endTest::TearDown() { cq_ = nullptr; } fixture_.reset(); -// TODO(hork): locate the windows leak so we can enable end2end experiments. -#ifndef GPR_WINDOWS // Creating an EventEngine requires gRPC initialization, which the NoOp test // does not do. Skip the EventEngine check if unnecessary. - if (grpc_is_initialized()) { - quiesce_event_engine_( - grpc_event_engine::experimental::GetDefaultEventEngine()); + if (ee != nullptr) { + quiesce_event_engine_(std::move(ee)); } -#endif if (do_shutdown) { grpc_shutdown_blocking(); // This will wait until gRPC shutdown has actually happened to make sure diff --git a/test/core/event_engine/event_engine_test_utils.cc b/test/core/event_engine/event_engine_test_utils.cc index 521ad5f80cf..7c0bcead1ce 100644 --- a/test/core/event_engine/event_engine_test_utils.cc +++ b/test/core/event_engine/event_engine_test_utils.cc @@ -75,7 +75,7 @@ std::string GetNextSendMessage() { return tmp_s; } -void WaitForSingleOwner(std::shared_ptr&& engine) { +void WaitForSingleOwner(std::shared_ptr engine) { while (engine.use_count() > 1) { GRPC_LOG_EVERY_N_SEC(2, GPR_INFO, "engine.use_count() = %ld", engine.use_count()); diff --git a/test/core/event_engine/event_engine_test_utils.h b/test/core/event_engine/event_engine_test_utils.h index ba1bdff7353..67bbe42d35d 100644 --- a/test/core/event_engine/event_engine_test_utils.h +++ b/test/core/event_engine/event_engine_test_utils.h @@ -47,7 +47,9 @@ std::string GetNextSendMessage(); // Waits until the use_count of the EventEngine shared_ptr has reached 1 // and returns. -void WaitForSingleOwner(std::shared_ptr&& engine); +// Callers must give up their ref, or this method will block forever. +// Usage: WaitForSingleOwner(std::move(engine)) +void WaitForSingleOwner(std::shared_ptr engine); // A helper method to exchange data between two endpoints. It is assumed // that both endpoints are connected. The data (specified as a string) is