aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2018-03-05 10:15:26 -0800
committerGravatar GitHub <noreply@github.com>2018-03-05 10:15:26 -0800
commitaa7fa513c12740d85f100ffe2dea465962c1ab97 (patch)
tree9c68ded6299eb413766b13f7a90de3e56cf19fa6 /test
parente5335b49ec35659c591bfbfb34825d181af5f4c3 (diff)
parent6fc5aba81a6506088cbd7eeb38e7ecc9132e396d (diff)
Merge pull request #14582 from markdroth/fake_resolver_test_fix
Fix asan failure in fake_resolver_test.
Diffstat (limited to 'test')
-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");
}