aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/client_channel
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2018-03-02 14:38:51 -0800
committerGravatar Mark D. Roth <roth@google.com>2018-03-02 14:38:51 -0800
commit6fc5aba81a6506088cbd7eeb38e7ecc9132e396d (patch)
tree602bee0f71c2dc883bff8bbcc00272620e32c7d8 /test/core/client_channel
parentc372f19bf4935c08665ffda929b831a98dea99c4 (diff)
Fix asan failure in fake_resolver_test.
Diffstat (limited to 'test/core/client_channel')
-rw-r--r--test/core/client_channel/resolvers/fake_resolver_test.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/core/client_channel/resolvers/fake_resolver_test.cc b/test/core/client_channel/resolvers/fake_resolver_test.cc
index 03af8954e1..14caa3ea5d 100644
--- a/test/core/client_channel/resolvers/fake_resolver_test.cc
+++ b/test/core/client_channel/resolvers/fake_resolver_test.cc
@@ -234,6 +234,11 @@ static void test_fake_resolver() {
grpc_timeout_milliseconds_to_deadline(100)) ==
nullptr);
// Clean up.
+ // Note: Need to explicitly unref the resolver and flush the exec_ctx
+ // to make sure that the final resolver callback (with error set to
+ // "Resolver Shutdown") is invoked before on_res_arg goes out of scope.
+ resolver.reset();
+ grpc_core::ExecCtx::Get()->Flush();
GRPC_COMBINER_UNREF(combiner, "test_fake_resolver");
}