Skip to content

Commit

Permalink
experiment
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Sep 23, 2024
1 parent 0cff921 commit 9a83f48
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions java/integTest/src/test/java/glide/PubSubTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;

@Disabled
@Timeout(30) // sec
public class PubSubTests {

Expand Down
2 changes: 2 additions & 0 deletions java/integTest/src/test/java/glide/SharedCommandTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,14 @@
import org.apache.commons.lang3.tuple.Pair;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

@Disabled
@Timeout(10) // seconds
public class SharedCommandTests {

Expand Down
27 changes: 27 additions & 0 deletions java/integTest/src/test/java/glide/cluster/ClusterClientTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
import static glide.TestUtilities.commonClusterClientConfig;
import static glide.TestUtilities.getRandomString;
import static glide.api.BaseClient.OK;
import static glide.api.models.commands.InfoOptions.Section.REPLICATION;
import static glide.api.models.configuration.RequestRoutingConfiguration.SlotType.PRIMARY;
import static glide.api.models.configuration.RequestRoutingConfiguration.SlotType.REPLICA;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

import glide.api.GlideClusterClient;
import glide.api.models.commands.InfoOptions.Section;
import glide.api.models.configuration.RequestRoutingConfiguration.SlotKeyRoute;
import glide.api.models.configuration.ServerCredentials;
import glide.api.models.exceptions.ClosingException;
import glide.api.models.exceptions.RequestException;
Expand Down Expand Up @@ -158,4 +163,26 @@ public void closed_client_throws_ExecutionException_with_ClosingException_as_cau
assertThrows(ExecutionException.class, () -> client.set("foo", "bar").get());
assertTrue(executionException.getCause() instanceof ClosingException);
}

@Test
@SneakyThrows
public void issue_2277() {
try (var client = GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) {
System.out.println("============= primary:");
var data =
client
.info(new Section[] {REPLICATION}, new SlotKeyRoute("1", PRIMARY))
.get()
.getSingleValue();
System.out.println(data);
System.out.println("============= replica:");
data =
client
.info(new Section[] {REPLICATION}, new SlotKeyRoute("1", REPLICA))
.get()
.getSingleValue();
System.out.println(data);
assertTrue(data.contains("role:slave"));
}
}
}
2 changes: 2 additions & 0 deletions java/integTest/src/test/java/glide/cluster/CommandTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@
import lombok.SneakyThrows;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;

@Disabled
@Timeout(10) // seconds
public class CommandTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

@Disabled
@Timeout(10) // seconds
public class CommandTests {

Expand Down

0 comments on commit 9a83f48

Please sign in to comment.