Skip to content

Make integration tests compatible with RE#4387

Merged
uglide merged 24 commits intomasterfrom
im/skip-it-not-compatible-with-re
Feb 26, 2026
Merged

Make integration tests compatible with RE#4387
uglide merged 24 commits intomasterfrom
im/skip-it-not-compatible-with-re

Conversation

@uglide
Copy link
Copy Markdown
Contributor

@uglide uglide commented Jan 2, 2026

  • Guard all RE-incompatible integration tests with @ConditionalOnEnv
  • Fixes all time-based issues when running tests against RE

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 2, 2026

Test Results

   301 files     301 suites   11m 53s ⏱️
10 908 tests 10 852 ✅ 56 💤 0 ❌
 5 631 runs   5 622 ✅  9 💤 0 ❌

Results for commit 0bca405.

♻️ This comment has been updated with latest results.

@uglide uglide force-pushed the im/skip-it-not-compatible-with-re branch 2 times, most recently from ee72417 to c266e87 Compare January 5, 2026 16:19
@uglide uglide force-pushed the im/skip-it-not-compatible-with-re branch 2 times, most recently from 2b77f6b to 74d5ebf Compare January 23, 2026 14:24
@uglide
Copy link
Copy Markdown
Contributor Author

uglide commented Jan 27, 2026

augment review

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Jan 27, 2026

🤖 Augment PR Summary

Summary: This PR updates Jedis integration tests to run cleanly against Redis Enterprise (RE) environments.

Changes:

  • Introduces widespread use of @ConditionalOnEnv to skip tests/variants that are incompatible with RE.
  • Adds/propagates the EnvCondition JUnit 5 extension in several base test classes so env-gated tests are evaluated consistently.
  • Skips or adjusts RE-incompatible command tests (e.g., blocking list ops, BITOP, SORT STORE, COPY/RENAME-related cases) across commandobjects/jedis/unified/pipeline suites.
  • Relaxes a few timing-sensitive assertions (e.g., HPTTL tolerance, OBJECT IDLETIME) to reduce flakiness.
  • Updates control/config tests to use slowlog-max-len instead of maxmemory for broader compatibility.
  • Improves stability in a few tests via small lifecycle/ordering tweaks (e.g., slowlog entry selection, cluster teardown guarding).

Technical Notes: The new environment gating relies on TestEnvUtil.TEST_ENV_PROVIDER and the EnvCondition execution condition to enable/disable tests at runtime.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

public class SentinelCommandsTest {

@RegisterExtension
public EnvCondition envCondition = new EnvCondition();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Because @ConditionalOnEnv is used at class level and prepare() does endpoint lookups, consider registering EnvCondition as a static @RegisterExtension (or via @ExtendWith) so the condition can disable the container before @BeforeAll runs in Redis Enterprise.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

equalsIgnoreCase make sense

@AfterAll
public static void resetRedisAfter() {
removeSlots();
if (endpoint != null) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

@uglide uglide force-pushed the im/skip-it-not-compatible-with-re branch 2 times, most recently from 5334382 to 659c4d4 Compare February 16, 2026 13:30
@uglide uglide force-pushed the im/skip-it-not-compatible-with-re branch from 1e67bce to 4ae3bd0 Compare February 20, 2026 16:55
uglide and others added 4 commits February 23, 2026 14:33
- 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-ci
Copy link
Copy Markdown

jit-ci Bot commented Feb 24, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@uglide uglide marked this pull request as ready for review February 24, 2026 15:32
@uglide uglide requested a review from ggivo February 24, 2026 15:32
Copy link
Copy Markdown
Collaborator

@ggivo ggivo left a comment

Choose a reason for hiding this comment

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

LGTM,

Added a note related to the timeseries test increase of timeouts. I think it is not needed

assertEquals(-1856719580, v.hashCode());
}

@Test
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@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();
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

First, we need to add missing time command to the UnifiedJedis :) Let's keep this change for later

@uglide uglide merged commit f669f98 into master Feb 26, 2026
13 of 14 checks passed
@uglide uglide deleted the im/skip-it-not-compatible-with-re branch February 26, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants