sanpwc commented on code in PR #6908:
URL: https://github.com/apache/ignite-3/pull/6908#discussion_r2498645936
##########
modules/runner/src/testFixtures/java/org/apache/ignite/internal/ClusterPerClassIntegrationTest.java:
##########
@@ -200,23 +199,32 @@ protected static void awaitPartitionsToBeHealthy(
IgniteImpl node = unwrapIgniteImpl(CLUSTER.aliveNode());
assertTrue(waitForCondition(() -> {
Review Comment:
I'd say that following will be a little bit easier to maintain when we will
drop the else clause after removing !colocation mode
```
protected static void awaitPartitionsToBeHealthy(
String zone,
Set<Integer> partitionIds
) throws InterruptedException {
IgniteImpl node = unwrapIgniteImpl(CLUSTER.aliveNode());
assertTrue(waitForCondition(() -> {
if (colocationEnabled()) {
CompletableFuture<Map<ZonePartitionId,
GlobalPartitionStateEnum>> globalPartitionStates =
node.disasterRecoveryManager()
.globalPartitionStates(Set.of(zone),
partitionIds)
.thenApply(map -> map.entrySet().stream()
.collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().state)));
assertThat(globalPartitionStates,
willCompleteSuccessfully());
try {
return globalPartitionStates.get().values()
.stream()
.allMatch(state -> state ==
GlobalPartitionStateEnum.AVAILABLE);
} catch (InterruptedException | ExecutionException
e) {
throw new RuntimeException(e);
}
} else {
CompletableFuture<Map<TablePartitionId,
GlobalPartitionStateEnum>> globalPartitionStates =
node.disasterRecoveryManager()
.globalTablePartitionStates(Set.of(zone),
partitionIds)
.thenApply(map -> map.entrySet().stream()
.collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().state)));
assertThat(globalPartitionStates,
willCompleteSuccessfully());
try {
return globalPartitionStates.get().values()
.stream()
.allMatch(state -> state ==
GlobalPartitionStateEnum.AVAILABLE);
} catch (InterruptedException | ExecutionException
e) {
throw new RuntimeException(e);
}
}
},
30_000
));
}
```
Besides that I'd rather use static imports for things like assertThat().
Up to you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]