diff --git a/src/test/java/io/lettuce/core/commands/SetCommandIntegrationTests.java b/src/test/java/io/lettuce/core/commands/SetCommandIntegrationTests.java index 71fdf700bf..8a5fb87262 100644 --- a/src/test/java/io/lettuce/core/commands/SetCommandIntegrationTests.java +++ b/src/test/java/io/lettuce/core/commands/SetCommandIntegrationTests.java @@ -358,7 +358,7 @@ void sscanMultiple() { Set expect = new HashSet<>(); Set check = new HashSet<>(); - setup100KeyValues(expect); + setup129KeyValues(expect); ValueScanCursor cursor = redis.sscan(key, ScanArgs.Builder.limit(5)); @@ -379,18 +379,20 @@ void sscanMultiple() { void scanMatch() { Set expect = new HashSet<>(); - setup100KeyValues(expect); + setup129KeyValues(expect); ValueScanCursor cursor = redis.sscan(key, ScanArgs.Builder.limit(200).match("value1*")); assertThat(cursor.getCursor()).isEqualTo("0"); assertThat(cursor.isFinished()).isTrue(); - assertThat(cursor.getValues()).hasSize(11); + assertThat(cursor.getValues()).hasSize(40); } - void setup100KeyValues(Set expect) { - for (int i = 0; i < 100; i++) { + void setup129KeyValues(Set expect) { + // Redis 7.0 introduce listpack, and `set-max-listpack-entries` is 128 + // so we add 129 elements to convert it to hashtable + for (int i = 0; i < 129; i++) { redis.sadd(key, value + i); expect.add(value + i); }