From 9ab9a7684dab96a47056c3bacbd957ddf49dab88 Mon Sep 17 00:00:00 2001 From: John Sully Date: Sun, 31 May 2020 21:26:21 -0400 Subject: [PATCH] PUBSUB test reliability: A client race was erroneously failing tests (test only issue) Former-commit-id: 5147f0153ad1efb827a1709c10cd0f58e6ae65d8 --- tests/unit/pubsub.tcl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/pubsub.tcl b/tests/unit/pubsub.tcl index 9c7a43bf0..6c991ac97 100644 --- a/tests/unit/pubsub.tcl +++ b/tests/unit/pubsub.tcl @@ -107,6 +107,8 @@ start_server {tags {"pubsub"}} { set rd1 [redis_deferring_client] assert_equal {1 2 3} [subscribe $rd1 {chan1 chan2 chan3}] unsubscribe $rd1 + # Wait for a response to the unsub + __consume_subscribe_messages $rd1 unsubscribe {chan1 chan2 chan3} assert_equal 0 [r publish chan1 hello] assert_equal 0 [r publish chan2 hello] assert_equal 0 [r publish chan3 hello] @@ -180,6 +182,8 @@ start_server {tags {"pubsub"}} { set rd1 [redis_deferring_client] assert_equal {1 2 3} [psubscribe $rd1 {chan1.* chan2.* chan3.*}] punsubscribe $rd1 + # Wait for a response to the unsub + __consume_subscribe_messages $rd1 punsubscribe {chan1.* chan2.* chan3.*} assert_equal 0 [r publish chan1.hi hello] assert_equal 0 [r publish chan2.hi hello] assert_equal 0 [r publish chan3.hi hello]