We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e9b9f9 commit 3fc64f2Copy full SHA for 3fc64f2
tests/test_pubsub.py
@@ -777,3 +777,22 @@ def get_msg():
777
778
# the timeout on the read should not cause disconnect
779
assert is_connected()
780
+
781
782
+@pytest.mark.onlynoncluster
783
+class TestConnectionLeak:
784
+ def test_connection_leak(self, r: redis.Redis):
785
+ pubsub = r.pubsub()
786
787
+ def test():
788
+ tid = threading.get_ident()
789
+ pubsub.subscribe(f"foo{tid}")
790
791
+ threads = [threading.Thread(target=test) for _ in range(10)]
792
+ for thread in threads:
793
+ thread.start()
794
795
796
+ thread.join()
797
798
+ assert r.connection_pool._created_connections == 2
0 commit comments