From ea89c4f100a131e5df2410e52650253e704d2b7a Mon Sep 17 00:00:00 2001 From: Barak Hirsch Date: Thu, 28 Sep 2023 09:30:22 +0300 Subject: [PATCH] Fix scan test failing over COUNT being a recommendation and not strict --- integration/generic_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/integration/generic_test.go b/integration/generic_test.go index 63a26bf0..4503f7cc 100644 --- a/integration/generic_test.go +++ b/integration/generic_test.go @@ -164,8 +164,9 @@ func TestScan(t *testing.T) { c.Do("SCAN", "0", "TYPE", "set", "MATCH", "setkey") c.Do("SCAN", "0", "TYPE", "set", "COUNT", "100") c.Do("SCAN", "0", "TYPE", "set", "MATCH", "setkey", "COUNT", "100") - c.DoLoosely("SCAN", "0", "COUNT", "1") // cursor differs - c.DoLoosely("SCAN", "0", "COUNT", "2") // cursor differs + + // SCAN may return a higher count of items than requested (See https://redis.io/docs/manual/keyspace/), so we must query all items. + c.DoLoosely("SCAN", "0", "COUNT", "100") // cursor differs // Can't really test multiple keys. // c.Do("SET", "key2", "value2")