From d061dc762d4590a20527c93f35e37720040d0d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Mon, 23 Sep 2024 16:00:32 +0200 Subject: [PATCH] Update test of pubsub-replies without a channel/pattern string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Perform the punsubscribe before entering non-pubsub mode since Valkey 8 dont allow several UNSUBSCRIBE commands executed under non-pubsub mode. See https://github.com/valkey-io/valkey/pull/759 Signed-off-by: Björn Svensson --- tests/client_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/client_test.c b/tests/client_test.c index ef48f13..75fa8b6 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -1886,14 +1886,14 @@ void subscribe_channel_a_cb(valkeyAsyncContext *ac, void *r, void *privdata) { strcmp(reply->element[2]->str, "Hello!") == 0); state->checkpoint++; - /* Unsubscribe to channels, including channel X & Z which we don't subscribe to */ - valkeyAsyncCommand(ac, unexpected_cb, - (void *)"unsubscribe should not call unexpected_cb()", - "unsubscribe B X A A Z"); /* Unsubscribe to patterns, none which we subscribe to */ valkeyAsyncCommand(ac, unexpected_cb, (void *)"punsubscribe should not call unexpected_cb()", "punsubscribe"); + /* Unsubscribe to channels, including channel X & Z which we don't subscribe to */ + valkeyAsyncCommand(ac, unexpected_cb, + (void *)"unsubscribe should not call unexpected_cb()", + "unsubscribe B X A A Z"); /* Send a regular command after unsubscribing, then disconnect */ state->disconnect = 1; valkeyAsyncCommand(ac, integer_cb, state, "LPUSH mylist foo");