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 Aug 7, 2024
1 parent 299f828 commit fafb960
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions java/integTest/src/test/java/glide/SharedClientTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import static glide.TestUtilities.commonClusterClientConfig;
import static glide.TestUtilities.getRandomString;
import static glide.api.BaseClient.OK;
import static glide.api.models.commands.FlushMode.SYNC;
import static glide.api.models.configuration.RequestRoutingConfiguration.SimpleMultiNodeRoute.ALL_PRIMARIES;
import static org.junit.jupiter.api.Assertions.assertEquals;

import glide.api.BaseClient;
Expand Down Expand Up @@ -97,6 +99,7 @@ private static Stream<Arguments> clientAndDataSize() {

@ParameterizedTest(autoCloseArguments = false)
@MethodSource("clientAndDataSize")
@SneakyThrows
public void client_can_handle_concurrent_workload(BaseClient client, int valueSize) {
ExecutorService executorService = Executors.newCachedThreadPool();
@SuppressWarnings("unchecked")
Expand All @@ -121,5 +124,10 @@ public void client_can_handle_concurrent_workload(BaseClient client, int valueSi
CompletableFuture.allOf(futures).join();

executorService.shutdown();
if (client instanceof GlideClient) {
((GlideClient) client).flushall(SYNC).get();
} else if (client instanceof GlideClusterClient) {
((GlideClusterClient) client).flushall(SYNC, ALL_PRIMARIES).get();
}
}
}

0 comments on commit fafb960

Please sign in to comment.