make sure to close manually created (not fixture) remote connection
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5debb598 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5debb598 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5debb598 Branch: refs/heads/TINKERPOP-1599 Commit: 5debb59818f1120d6d9156bd8784bc1187350322 Parents: 7b58816 Author: davebshow <[email protected]> Authored: Mon Jan 30 20:07:03 2017 -0500 Committer: davebshow <[email protected]> Committed: Wed Feb 15 13:22:01 2017 -0500 ---------------------------------------------------------------------- .../tests/driver/test_driver_remote_connection_threaded.py | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5debb598/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py ---------------------------------------------------------------------- diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py index d5efc0d..dffd442 100644 --- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py +++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py @@ -54,7 +54,10 @@ def test_conn_in_threads(remote_connection): child2.join() def _executor(q, conn): + close = False if not conn: + # This isn't a fixture so close manually + close = True conn = DriverRemoteConnection( 'ws://localhost:45940/gremlin', 'g', pool_size=4) try: @@ -66,3 +69,6 @@ def _executor(q, conn): q.put(sys.exc_info()[0]) else: q.put('success!') + # Close conn + if close: + conn.close()
