Skip to content

Topic/ggivo/cae 2680 redis server stub for push notifications#4487

Open
ggivo wants to merge 14 commits into
feature/hu-notifications-rebased-wo-generic-push-listenersfrom
topic/ggivo/CAE-2680-redis-server-stub-for-push-notifications
Open

Topic/ggivo/cae 2680 redis server stub for push notifications#4487
ggivo wants to merge 14 commits into
feature/hu-notifications-rebased-wo-generic-push-listenersfrom
topic/ggivo/CAE-2680-redis-server-stub-for-push-notifications

Conversation

@ggivo
Copy link
Copy Markdown
Collaborator

@ggivo ggivo commented Apr 14, 2026

Note

Medium Risk
Moderate risk because it replaces the custom test server infrastructure and rewrites several timing-sensitive tests; failures are likely to surface as flaky/changed test behavior even though production code is largely untouched.

Overview
Introduces a new in-test RESP3 RedisServerStub (with an in-memory datastore, command registry, push injection, and a pub/sub manager) and removes the previous redis.clients.jedis.util.server.TcpMockServer/RespResponse/CommandHandler utilities.

Updates existing mock-based tests (ConnectionMockTest, CacheConnectionMockTest, UnifiedJedisProactiveRebindTest, ConnectionAdaptiveTimeoutTest) to use RedisServerStub and explicit MaintenanceEvent push messages; the adaptive-timeout test is reworked to use a command interceptor + async blocking to simulate blocking behavior.

Adds new RedisClient pub/sub test suite: a shared RedisClientPubSubTestBase, a real-server integration test (RedisClientPubSubIT) for RESP2/RESP3, and a RESP3-only mock test (RedisClientPubSubMockTest) plus PubSubTestHelper. Also expands the formatter plugin includes to cover new server and pubsub test packages.

Reviewed by Cursor Bugbot for commit 9b790db. Bugbot is set up for automated code reviews on this repo. Configure here.

ggivo added 6 commits April 14, 2026 12:26
  - redis-stub-server core infrastructure and command framework files

# Conflicts:
#	src/test/java/redis/clients/jedis/upgrade/ConnectionAdaptiveTimeoutTest.java
#	src/test/java/redis/clients/jedis/util/server/TcpMockServer.java
 - prepare infra to run basic pub/sub tests agains RedisServerStub
 - add pub/sub tests against RedisServerStub verifying arbitrary push messages are handled
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 14, 2026

Test Results

  177 files  +1    177 suites  +1   10m 50s ⏱️ -30s
8 535 tests +8  7 666 ✅  - 650  869 💤 +658  0 ❌ ±0 
3 228 runs   - 5  2 940 ✅  - 230  288 💤 +225  0 ❌ ±0 

Results for commit 9b790db. ± Comparison against base commit 28a4814.

♻️ This comment has been updated with latest results.

@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented Apr 14, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Comment thread src/test/java/redis/server/stub/ClientHandler.java
Comment thread src/test/java/redis/server/stub/CommandContext.java
Comment thread src/test/java/redis/server/stub/command/server/HelloCommand.java
Comment thread src/test/java/redis/server/stub/command/server/ClientCommand.java
Comment thread src/test/java/redis/server/stub/TcpMockServer.java
Comment thread src/test/java/redis/server/stub/RedisServerStub.java Outdated
Comment thread src/test/java/redis/server/stub/RedisServerStub.java
Copy link
Copy Markdown

@cursor cursor Bot left a 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 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9b790db. Configure here.

"Socket timeout should be relaxed blocking timeout during blocking command");
// await command to be executed
Awaitility.await().atMost(Duration.ofSeconds(100))
.until(() -> connection.isRelaxedTimeoutActive());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awaitility timeout vastly exceeds JUnit test timeout

Low Severity

The test has @Timeout(value = 1, unit = TimeUnit.SECONDS) but both Awaitility.await().atMost(Duration.ofSeconds(100)) calls use a 100-second max wait. Awaitility's timeout can never trigger because JUnit kills the test at 1 second first, producing a generic timeout error instead of Awaitility's descriptive condition-not-met failure. The 100 likely should be 1 or the @Timeout value needs increasing.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9b790db. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant