Topic/ggivo/cae 2680 redis server stub for push notifications#4487
Conversation
- 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
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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()); |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit 9b790db. Configure here.


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 previousredis.clients.jedis.util.server.TcpMockServer/RespResponse/CommandHandlerutilities.Updates existing mock-based tests (
ConnectionMockTest,CacheConnectionMockTest,UnifiedJedisProactiveRebindTest,ConnectionAdaptiveTimeoutTest) to useRedisServerStuband explicitMaintenanceEventpush 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) plusPubSubTestHelper. Also expands the formatter plugin includes to cover newserverandpubsubtest packages.Reviewed by Cursor Bugbot for commit 9b790db. Bugbot is set up for automated code reviews on this repo. Configure here.