Skip to content

Commit d5c14c8

Browse files
committed
Increased pubsub wait for response timeout to fix flaky tests
1 parent 78b48ea commit d5c14c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_cluster.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ def test_cluster_pubsub_channels(self, r):
782782
p = r.pubsub()
783783
p.subscribe('foo', 'bar', 'baz', 'quux')
784784
for i in range(4):
785-
assert wait_for_message(p)['type'] == 'subscribe'
785+
assert wait_for_message(p, timeout=0.5)['type'] == 'subscribe'
786786
expected = [b'bar', b'baz', b'foo', b'quux']
787787
assert all([channel in r.pubsub_channels(target_nodes='all')
788788
for channel in expected])
@@ -792,14 +792,14 @@ def test_cluster_pubsub_numsub(self, r):
792792
p1 = r.pubsub()
793793
p1.subscribe('foo', 'bar', 'baz')
794794
for i in range(3):
795-
assert wait_for_message(p1)['type'] == 'subscribe'
795+
assert wait_for_message(p1, timeout=0.5)['type'] == 'subscribe'
796796
p2 = r.pubsub()
797797
p2.subscribe('bar', 'baz')
798798
for i in range(2):
799-
assert wait_for_message(p2)['type'] == 'subscribe'
799+
assert wait_for_message(p2, timeout=0.5)['type'] == 'subscribe'
800800
p3 = r.pubsub()
801801
p3.subscribe('baz')
802-
assert wait_for_message(p3)['type'] == 'subscribe'
802+
assert wait_for_message(p3, timeout=0.5)['type'] == 'subscribe'
803803

804804
channels = [(b'foo', 1), (b'bar', 2), (b'baz', 3)]
805805
assert r.pubsub_numsub('foo', 'bar', 'baz', target_nodes='all') \

0 commit comments

Comments
 (0)