GeezerVison is showing github.com — Improve CI pipeline stability by atakavci · Pull Request #4512 · redis/jedis
Conversation
atakavci
commented
May 7, 2026
•
edited by cursor
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
A handful of integration tests were intermittently failing in CI because they asserted Redis-server-internal behavior (LRU-clock resolution, SCAN pagination cadence) rather than the Jedis client contract. This PR removes / relaxes those server-behavior assertions while keeping the Jedis-surface checks intact.
Issue
Three flake patterns were observed:
-
OBJECT IDLETIME after Thread.sleep(...) — asserted > 0. Redis tracks idle time via a cached server.lruclock with 1-second resolution, updated by serverCron (default hz 10). When SET and OBJECT IDLETIME land in the same LRU tick, the value is 0 and the assertion fails. Observed in CommandObjectsServerManagementCommandsTest#testObjectIdletime and inside the various touch() tests.
-
SCAN ... COUNT 4 TYPE string over 7 keys — asserted that the first page does not complete the iteration (assertFalse(isCompleteIteration())). COUNT is documented as a hint; with a small dict the entire keyspace can fit in one page and Redis returns cursor 0. The neighboring scanIsCompleteIteration test already documents this with a 100-key dataset and a comment pointing to the Redis docs. Observed in RedisClientAllKindOfValuesCommandsTest#scanType.
None of these assertions exercise Jedis-side encoding, cursor round-trip, or response decoding — they only exercise Redis's own scheduling.
Fix
objectIdletime assertions in the affected tests are relaxed to >= 0 and the surrounding Thread.sleep(1100) calls are removed. The TOUCH count assertions (the actual Jedis contract) are unchanged.
scanType is rewritten to iterate to completion via the cursor returned by Jedis and assert the union of returned keys equals the expected set, instead of asserting a specific per-page cursor state. This still covers the Jedis-relevant behavior: SCAN ... [COUNT n] TYPE <t> encoding, cursor round-trip (both String and byte[]), and response decoding.
Note Low Risk
Low risk: changes are limited to integration test assertions/structure to avoid Redis-server timing and SCAN pagination variability, with no production code impact.
Overview
Improves CI stability by removing timing- and server-internals-dependent assertions in Redis integration tests.
OBJECT IDLETIME checks no longer rely on Thread.sleep(...) and now assert >= 0 (string and binary variants, including cluster/unified tests). SCAN ... TYPE string tests are rewritten to iterate cursors to completion and assert the union of returned keys matches expectations instead of asserting specific pagination/isCompleteIteration() behavior.
Reviewed by Cursor Bugbot for commit 7a16fa1. 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.

Reviewed by Cursor Bugbot for commit 16a3ed1. Configure here.
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.
|
|
binaryResult = jedis.scan(binaryResult.getCursorAsBytes(), pagingParams, string);
|
|
|
assertTrue(binaryResult.isCompleteIteration());
|
|
|
page2Count = binaryResult.getResult().size();
|
|
|
int page2Count = binaryResult.getResult().size();
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Binary SCAN still uses flaky pagination assertion
Medium Severity
The binary section of scanType still asserts assertFalse(binaryResult.isCompleteIteration()) on the first page — the same flaky server-behavior assumption this PR removes from the string section (lines 852–860) and from AllKindOfValuesCommandsTestBase.java. With a small dict and COUNT 4, Redis may return all results in one page, causing intermittent test failure.
Reviewed by Cursor Bugbot for commit 16a3ed1. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR aims to reduce CI flakiness by relaxing/removing test assertions that depend on Redis server-internal timing/pagination behavior (LRU-clock resolution for OBJECT IDLETIME, and SCAN COUNT pagination cadence) rather than the Jedis client contract.
Changes:
- Relaxed
OBJECT IDLETIME assertions (and removed sleeps) to avoid timing-dependent failures.
- Reworked
SCAN ... TYPE string tests to iterate via returned cursors and assert the union of keys returned.
- Minor formatting cleanup in one assertion.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File |
Description |
| src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterAllKindOfValuesCommandsTest.java |
Updates cluster unified tests for touch() and rewrites scanType() string SCAN assertions. |
| src/test/java/redis/clients/jedis/commands/unified/AllKindOfValuesCommandsTestBase.java |
Updates unified base tests to relax objectIdletime checks and rewrites scanType() (String + binary) to scan to completion. |
| src/test/java/redis/clients/jedis/commands/jedis/AllKindOfValuesCommandsTest.java |
Updates standalone Jedis tests to relax objectIdletime checks and rewrites scanType() String branch (binary branch still page-dependent). |
| src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsServerManagementCommandsTest.java |
Relaxes objectIdletime assertions in command-object tests to avoid LRU tick timing flakiness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Comment on lines
+677
to
+687
|
|
Set<byte[]> binaryStringKeys = new HashSet<>();
|
|
|
byte[] binaryCursor = SCAN_POINTER_START_BINARY;
|
|
|
ScanResult<byte[]> binaryResult;
|
|
|
do {
|
|
|
binaryResult = jedis.scan(binaryCursor, pagingParams, string);
|
|
|
binaryStringKeys.addAll(binaryResult.getResult());
|
|
|
binaryCursor = binaryResult.getCursorAsBytes();
|
|
|
} while (!binaryResult.isCompleteIteration());
|
|
|
Set<byte[]> expectedBinaryStringKeys = new HashSet<>(Arrays.asList(
|
|
|
"a".getBytes(), "c".getBytes(), "e".getBytes(), "g".getBytes()));
|
|
|
AssertUtil.assertByteArraySetEquals(expectedBinaryStringKeys, binaryStringKeys);
|
Comment on lines
885
to
891
|
|
binaryResult = jedis.scan(SCAN_POINTER_START_BINARY, pagingParams, string);
|
|
|
assertFalse(binaryResult.isCompleteIteration());
|
|
|
page1Count = binaryResult.getResult().size();
|
|
|
int page1Count = binaryResult.getResult().size();
|
|
|
binaryResult = jedis.scan(binaryResult.getCursorAsBytes(), pagingParams, string);
|
|
|
assertTrue(binaryResult.isCompleteIteration());
|
|
|
page2Count = binaryResult.getResult().size();
|
|
|
int page2Count = binaryResult.getResult().size();
|
|
|
assertEquals(4, page1Count + page2Count);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Reviewers
ggivo
ggivo approved these changes
a-TODO-rov
Awaiting requested review from a-TODO-rov
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
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.
|