Merge pull request #17929 from ericgribkoff/abort_test_flake

fix flake in test_abort_does_not_leak_local_vars
pull/17934/head
Eric Gribkoff 6 years ago committed by GitHub
commit 5e50a89502
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/python/grpcio_tests/tests/unit/_abort_test.py

@ -120,13 +120,13 @@ class AbortTest(unittest.TestCase):
weak_ref = weakref.ref(do_not_leak_me)
# Servicer will abort() after creating a local ref to do_not_leak_me.
with self.assertRaises(grpc.RpcError) as exception_context:
with self.assertRaises(grpc.RpcError):
self._channel.unary_unary(_ABORT)(_REQUEST)
rpc_error = exception_context.exception
# Server may still have a stack frame reference to the exception even
# after client sees error, so ensure server has shutdown.
self._server.stop(None)
do_not_leak_me = None
# Force garbage collection
gc.collect()
self.assertIsNone(weak_ref())
def test_abort_with_status(self):

Loading…
Cancel
Save