Make integration tests compatible with RE#4387
Conversation
Test Results 301 files 301 suites 11m 53s ⏱️ Results for commit 0bca405. ♻️ This comment has been updated with latest results. |
ee72417 to
c266e87
Compare
2b77f6b to
74d5ebf
Compare
|
augment review |
🤖 Augment PR SummarySummary: This PR updates Jedis integration tests to run cleanly against Redis Enterprise (RE) environments. Changes:
Technical Notes: The new environment gating relies on 🤖 Was this summary useful? React with 👍 or 👎 |
| public class SentinelCommandsTest { | ||
|
|
||
| @RegisterExtension | ||
| public EnvCondition envCondition = new EnvCondition(); |
There was a problem hiding this comment.
| assertEquals(0, client.clientList(ClientType.MASTER).length()); | ||
| assertEquals(1, client.clientList(ClientType.SLAVE).split("\\n").length); | ||
| assertEquals(1, client.clientList(ClientType.REPLICA).split("\\n").length); | ||
| if (!TestEnvUtil.getTestEnvProvider().equals(TestEnvUtil.ENV_REDIS_ENTERPRISE)) { |
There was a problem hiding this comment.
EnvCondition matches environments via equalsIgnoreCase, but this inline check uses equals, so TEST_ENV_PROVIDER=RE/Re would not be treated as Redis Enterprise here. Consider using a case-insensitive comparison for consistency with the rest of the environment gating.
🤖 Was this useful? React with 👍 or 👎
There was a problem hiding this comment.
equalsIgnoreCase make sense
| @AfterAll | ||
| public static void resetRedisAfter() { | ||
| removeSlots(); | ||
| if (endpoint != null) { |
There was a problem hiding this comment.
With the @BeforeAll slot reset removed, a previously “dirty” cluster-unbound could keep slot assignments between runs and impact early assertions. Consider doing a one-time removeSlots() after endpoint is initialized in prepareEndpoints(), in addition to the @AfterAll cleanup.
🤖 Was this useful? React with 👍 or 👎
5334382 to
659c4d4
Compare
- Use endpoint in useWithoutConnecting - Disable startWithUri() on RE
…rge data transfer
1e67bce to
4ae3bd0
Compare
…e' into im/skip-it-not-compatible-with-re
- Rely on correctly configured Redis Cluster instead of testing outdated workarounds with hostname mapping - Merge ACL, SSLOptions and RedisClusterClientIT into one test - Remove redundant utilities
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
ggivo
left a comment
There was a problem hiding this comment.
LGTM,
Added a note related to the timeseries test increase of timeouts. I think it is not needed
| assertEquals(-1856719580, v.hashCode()); | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
| @Test | |
| public void testAddStar() throws InterruptedException { | |
| Map<String, String> labels = new HashMap<>(); | |
| labels.put("l11", "v11"); | |
| labels.put("l22", "v22"); | |
| assertEquals("OK", client.tsCreate("seriesAdd2", TSCreateParams.createParams().retention(10000L).labels(labels))); | |
| // Use 50ms for cases when Redis is not running locally | |
| int delayInMillis = 2; | |
| long startTime = serverTime(jedis); | |
| long add1 = client.tsAdd("seriesAdd2", 1.1); | |
| assertTrue(add1 >= startTime); | |
| Thread.sleep(delayInMillis); | |
| long add2 = client.tsAdd("seriesAdd2", 3.2); | |
| assertTrue(add2 > startTime); | |
| Thread.sleep(delayInMillis); | |
| long add3 = client.tsAdd("seriesAdd2", 3.2); | |
| assertTrue(add3 > add2); | |
| Thread.sleep(delayInMillis); | |
| long add4 = client.tsAdd("seriesAdd2", -1.2); | |
| assertTrue(add4 > add3); | |
| Thread.sleep(delayInMillis); | |
| long endTime = serverTime(jedis); | |
| assertTrue(endTime > add4); | |
| List<TSElement> values = client.tsRange("seriesAdd2", startTime, add3); | |
| assertEquals(3, values.size()); | |
| } | |
| /** | |
| * Server time in milliseconds since the Epoch. | |
| * @param redis | |
| * @return | |
| */ | |
| long serverTime(Jedis redis) { | |
| List<String> serverTime = redis.time(); | |
| return Instant.ofEpochSecond(Long.parseLong(serverTime.get(0))) | |
| .plusMillis(Long.parseLong(serverTime.get(1)) / 1_000).toEpochMilli(); | |
| } |
There was a problem hiding this comment.
First, we need to add missing time command to the UnifiedJedis :) Let's keep this change for later
Uh oh!
There was an error while loading. Please reload this page.