From 8fcf3dc86600f8f1bf9bb6e7aa69b2d4e67f5957 Mon Sep 17 00:00:00 2001 From: Vitah Lin Date: Mon, 1 Jun 2026 13:31:20 +0800 Subject: [PATCH] Fix vector set tests to use RESP2 for default clients (#15287) ## Issue The vector set Python tests intentionally use two clients: - the default client (`self.redis`) for the existing RESP2-oriented test expectations - `self.redis3` for RESP3-specific coverage. However, the default client did not explicitly set a protocol, so it depended on redis-py's default behavior. With newer redis-py versions, RESP3 is now the default protocol(https://github.com/redis/redis-py/pull/4052). In particular, vector set replies such as `VSIM ... WITHSCORES` may be parsed into map/dict-like structures instead of the RESP2 flat-array shape assumed by existing tests. ## Changes Explicitly create the default primary and replica Redis clients with `protocol=2`. `self.redis3` is left unchanged and continues to use `protocol=3` for RESP3-specific test coverage. --- modules/vector-sets/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/vector-sets/test.py b/modules/vector-sets/test.py index 8d56d5827..0b5123336 100755 --- a/modules/vector-sets/test.py +++ b/modules/vector-sets/test.py @@ -96,10 +96,10 @@ class TestCase: self.error_details = None self.test_key = f"test:{self.__class__.__name__.lower()}" # Primary Redis instance - self.redis = redis.Redis(port=primary_port,db=9) + self.redis = redis.Redis(port=primary_port,protocol=2,db=9) self.redis3 = redis.Redis(port=primary_port,protocol=3,db=9) # Replica Redis instance - self.replica = redis.Redis(port=replica_port,db=9) + self.replica = redis.Redis(port=replica_port,protocol=2,db=9) # Replication status self.replication_setup = False # Ports