summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEugene Morozov <jmv@emorozov.net>2021-11-08 09:59:14 +0300
committerGitHub <noreply@github.com>2021-11-08 08:59:14 +0200
commitbba75187931af84dd21c91bcf1b3bd422c9aed72 (patch)
tree59c256b4929623e62f90038b35687b8239bbabf8 /tests
parent4257ceb1e5b438d9e7ea4d2ac0c74609c2771749 (diff)
downloadredis-py-bba75187931af84dd21c91bcf1b3bd422c9aed72.tar.gz
Fix garbage collection deadlock (#1578)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pubsub.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_pubsub.py b/tests/test_pubsub.py
index 6a4f0aa..4be6c7a 100644
--- a/tests/test_pubsub.py
+++ b/tests/test_pubsub.py
@@ -570,3 +570,15 @@ class TestPubSubWorkerThread:
assert event.wait(timeout=1.0)
pubsub_thread.join(timeout=1.0)
assert not pubsub_thread.is_alive()
+
+
+class TestPubSubDeadlock:
+ @pytest.mark.timeout(30, method='thread')
+ def test_pubsub_deadlock(self, master_host):
+ pool = redis.ConnectionPool(host=master_host)
+ r = redis.Redis(connection_pool=pool)
+
+ for i in range(60):
+ p = r.pubsub()
+ p.subscribe("my-channel-1", "my-channel-2")
+ pool.reset()