Skip to content

Commit

Permalink
fix use-after-free in test shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
markdroth committed Sep 8, 2023
1 parent 0786d30 commit 6b4bf75
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/core/client_channel/lb_policy/lb_policy_test_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,9 @@ class LoadBalancingPolicyTest : public ::testing::Test {
grpc_event_engine::experimental::GetDefaultEventEngine())) {}

void TearDown() override {
// Some policies may hop into the WorkSerializer to unref subchannels.
// Need to make sure this gets flushed before the test fixture is destroyed.
WaitForWorkSerializerToFlush();
// Note: Can't safely trigger this from inside the FakeHelper dtor,
// because if there is a picker in the queue that is holding a ref
// to the LB policy, that will prevent the LB policy from being
Expand Down

0 comments on commit 6b4bf75

Please sign in to comment.