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 fa27fe9Copy full SHA for fa27fe9
tests/test_pubsub.py
@@ -777,3 +777,21 @@ def get_msg():
777
778
# the timeout on the read should not cause disconnect
779
assert is_connected()
780
+
781
782
+class TestConnectionLeak:
783
+ def test_connection_leak(self, r: redis.Redis):
784
+ pubsub = r.pubsub()
785
786
+ def test():
787
+ tid = threading.get_ident()
788
+ pubsub.subscribe(f"foo{tid}")
789
790
+ threads = [threading.Thread(target=test) for _ in range(10)]
791
+ for thread in threads:
792
+ thread.start()
793
794
795
+ thread.join()
796
797
+ assert r.connection_pool._created_connections == 2
0 commit comments