GeezerVison is showing github.com — Fix flaky scanType test assuming SCAN page boundaries by ggivo · Pull Request #4615 · redis/jedis
Conversation
ggivo
commented
Jul 10, 2026
•
edited by cursor
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
What
Fixes a sporadic failure in the legacy AllKindOfValuesCommandsTest.scanType by removing assertions on SCAN page boundaries.
Why
The binary section asserted that SCAN 0 COUNT 4 TYPE string over 7 keys cannot complete in one page (assertFalse(isCompleteIteration())). COUNT is only a hint: whether one call traverses the whole dict depends on how the keys distribute across hash buckets, which varies with the per-server random SipHash seed — so the test failed sporadically:
org.opentest4j.AssertionFailedError: expected: <false> but was: <true>
at ...AllKindOfValuesCommandsTest.scanType(AllKindOfValuesCommandsTest.java:886)
The unified variant (commands/unified/AllKindOfValuesCommandsTestBase#scanType) was already fixed with a cursor loop; the legacy copy was left behind.
Changes
- Replaced the two-page assertions (
assertFalse/assertTrue on isCompleteIteration(), page-count sum) with a cursor loop that iterates until completion and asserts on the collected key set, mirroring AllKindOfValuesCommandsTestBase#scanType verbatim.
Note: scanIsCompleteIteration also asserts assertFalse(isCompleteIteration()) on a first page, but over 100 keys with default COUNT — a documented, practically safe assumption (see the comment/link in the test) — and is left unchanged.
Verified against a local Redis: the class passes in all parameterized variants (162 tests, 0 failures).
Note Low Risk
Test-only change; no production code or runtime behavior affected.
Overview
Fixes sporadic failures in AllKindOfValuesCommandsTest.scanType for the binary TYPE string path by stopping assumptions about how many SCAN pages COUNT 4 needs.
The test no longer asserts that the first SCAN call is incomplete, that the second completes, or that page sizes sum to four keys. It now loops the cursor until iteration completes, aggregates keys, and asserts the set equals {a, c, e, g}—matching the pattern already used in the unified AllKindOfValuesCommandsTestBase#scanType and the string-key section of the same test.
Reviewed by Cursor Bugbot for commit 5060767. Bugbot is set up for automated code reviews on this repo. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
SCAN COUNT is only a hint: over a 7-key dict a single COUNT 4 call may
legitimately return cursor 0, depending on the per-server random hash
seed, so asserting the first page is incomplete fails sporadically.
Iterate until the cursor reports completion and assert on the collected
keys, mirroring the already-fixed unified variant in
AllKindOfValuesCommandsTestBase#scanType.
Test Results
206 files ± 0 206 suites ±0 10m 3s ⏱️ -25s
7 837 tests - 12 6 840 ✅ - 939 997 💤 +927 0 ❌ ±0
7 845 runs - 24 6 840 ✅ - 959 1 005 💤 +935 0 ❌ ±0
Results for commit 5060767. ± Comparison against base commit 61411d8.
This pull request removes 14 and adds 2 tests. Note that renamed tests count towards both.
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest[1] ‑ testScorer(Scorer, double, double)[1][1]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest[1] ‑ testScorer(Scorer, double, double)[1][2]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest[1] ‑ testScorer(Scorer, double, double)[1][3]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest[1] ‑ testScorer(Scorer, double, double)[1][4]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest[1] ‑ testScorer(Scorer, double, double)[1][5]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest[1] ‑ testScorer(Scorer, double, double)[1][6]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest[1] ‑ testScorer(Scorer, double, double)[1][7]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest[2] ‑ testScorer(Scorer, double, double)[2][1]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest[2] ‑ testScorer(Scorer, double, double)[2][2]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest[2] ‑ testScorer(Scorer, double, double)[2][3]
…
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest ‑ testScorer(Scorer, double, double)[1]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest ‑ testScorer(Scorer, double, double)[2]
This pull request skips 925 tests.
redis.clients.jedis.commands.commandobjects.CommandObjectsArrayCommandsTest[1] ‑ testArcountMissingKey()[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsArrayCommandsTest[1] ‑ testArcountMissingKeyBinary()[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsArrayCommandsTest[1] ‑ testArdel()[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsArrayCommandsTest[1] ‑ testArdelBinary()[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsArrayCommandsTest[1] ‑ testArdelrange()[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsArrayCommandsTest[1] ‑ testArdelrangeBinary()[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsArrayCommandsTest[1] ‑ testArget()[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsArrayCommandsTest[1] ‑ testArgetBinary()[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsArrayCommandsTest[1] ‑ testArgetrange()[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsArrayCommandsTest[1] ‑ testArgetrangeBinary()[1]
…
♻️ This comment has been updated with latest results.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|