Skip to content

Commit

Permalink
Troubleshoot failing CI test (passing locally)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggivo committed Dec 3, 2024
1 parent e04a01d commit 51c95ed
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ void nodeSelectionApiShouldWork() {
void shouldPerformNodeConnectionReauth() {

try (StatefulRedisClusterConnection<String, String> connection = redisClient.connect()) {
connection.getPartitions().forEach(
partition -> createTestUser(connection.getConnection(partition.getNodeId()).sync()));
connection.getPartitions()
.forEach(partition -> createTestUser(connection.getConnection(partition.getNodeId()).sync()));

credentialsProvider.emitCredentials(TestSettings.aclUsername(),
TestSettings.aclPassword().toString().toCharArray());
Expand All @@ -158,14 +158,14 @@ void shouldPerformNodeConnectionReauth() {
assertThat(authenticatedUser).isEqualTo(TestSettings.aclUsername());
});

connection.getPartitions().forEach(
partition -> deleteTestUser(connection.getConnection(partition.getNodeId()).sync()));
connection.getPartitions()
.forEach(partition -> deleteTestUser(connection.getConnection(partition.getNodeId()).sync()));
}
}

public static void createTestUser(RedisCommands<String, String> commands) {
Command<String, String, List<Object>> command = CliParser.parse(
"ACL SETUSER " + TestSettings.aclUsername() + " on >" + TestSettings.aclPassword() + " ~cached:* +@all");
Command<String, String, List<Object>> command = CliParser
.parse("ACL SETUSER " + TestSettings.aclUsername() + " on >" + TestSettings.aclPassword() + " ~cached:* +@all");
commands.dispatch(command.getType(), command.getOutput(), command.getArgs());
}

Expand All @@ -174,4 +174,5 @@ public static void deleteTestUser(RedisCommands<String, String> commands) {
commands.dispatch(command.getType(), command.getOutput(), command.getArgs());

}

}

0 comments on commit 51c95ed

Please sign in to comment.