This is an automated email from the ASF dual-hosted git repository.

sanpwc pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new cda2b2a517a IGNITE-26954 Support disabled collocation in 
awaitPartitionsToBeHealthy (#6908)
cda2b2a517a is described below

commit cda2b2a517a9a85786f9bad843306ff6d801720f
Author: Egor <[email protected]>
AuthorDate: Thu Nov 6 16:37:24 2025 +0400

    IGNITE-26954 Support disabled collocation in awaitPartitionsToBeHealthy 
(#6908)
    
    Co-authored-by: Egor Kuts <[email protected]>
---
 .../internal/ClusterPerClassIntegrationTest.java   | 30 ++++++++++++++--------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git 
a/modules/runner/src/testFixtures/java/org/apache/ignite/internal/ClusterPerClassIntegrationTest.java
 
b/modules/runner/src/testFixtures/java/org/apache/ignite/internal/ClusterPerClassIntegrationTest.java
index 7b06ce329f9..220cbfd61c5 100644
--- 
a/modules/runner/src/testFixtures/java/org/apache/ignite/internal/ClusterPerClassIntegrationTest.java
+++ 
b/modules/runner/src/testFixtures/java/org/apache/ignite/internal/ClusterPerClassIntegrationTest.java
@@ -22,9 +22,11 @@ import static 
org.apache.ignite.internal.TestWrappers.unwrapIgniteImpl;
 import static 
org.apache.ignite.internal.catalog.CatalogService.DEFAULT_STORAGE_PROFILE;
 import static 
org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus.AVAILABLE;
 import static org.apache.ignite.internal.lang.IgniteStringFormatter.format;
+import static 
org.apache.ignite.internal.lang.IgniteSystemProperties.colocationEnabled;
 import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.waitForCondition;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
 import static org.apache.ignite.lang.util.IgniteNameUtils.quoteIfNeeded;
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.nio.file.Path;
@@ -52,10 +54,8 @@ import 
org.apache.ignite.internal.catalog.descriptors.CatalogSchemaDescriptor;
 import org.apache.ignite.internal.catalog.descriptors.CatalogZoneDescriptor;
 import org.apache.ignite.internal.hlc.HybridClock;
 import org.apache.ignite.internal.lang.IgniteBiTuple;
-import org.apache.ignite.internal.replicator.ZonePartitionId;
 import org.apache.ignite.internal.sql.SqlCommon;
 import org.apache.ignite.internal.storage.impl.TestMvTableStorage;
-import 
org.apache.ignite.internal.table.distributed.disaster.GlobalPartitionState;
 import 
org.apache.ignite.internal.table.distributed.disaster.GlobalPartitionStateEnum;
 import org.apache.ignite.internal.testframework.BaseIgniteAbstractTest;
 import org.apache.ignite.internal.testframework.TestIgnitionManager;
@@ -72,7 +72,6 @@ import org.apache.ignite.sql.Statement.StatementBuilder;
 import org.apache.ignite.table.Table;
 import org.apache.ignite.table.Tuple;
 import org.apache.ignite.tx.Transaction;
-import org.hamcrest.MatcherAssert;
 import org.jetbrains.annotations.Nullable;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
@@ -200,23 +199,32 @@ public abstract class ClusterPerClassIntegrationTest 
extends BaseIgniteAbstractT
         IgniteImpl node = unwrapIgniteImpl(CLUSTER.aliveNode());
 
         assertTrue(waitForCondition(() -> {
-                    CompletableFuture<Map<ZonePartitionId, 
GlobalPartitionState>> globalPartitionStates =
-                            
node.disasterRecoveryManager().globalPartitionStates(Set.of(zone), 
partitionIds);
+                    CompletableFuture<Map<?, GlobalPartitionStateEnum>> 
globalPartitionStates;
+
+                    if (colocationEnabled()) {
+                        globalPartitionStates = node.disasterRecoveryManager()
+                                .globalPartitionStates(Set.of(zone), 
partitionIds)
+                                .thenApply(map -> map.entrySet().stream()
+                                        
.collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().state)));
+                    } else {
+                        globalPartitionStates = node.disasterRecoveryManager()
+                                .globalTablePartitionStates(Set.of(zone), 
partitionIds)
+                                .thenApply(map -> map.entrySet().stream()
+                                        
.collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().state)));
+                    }
 
-                    MatcherAssert.assertThat(globalPartitionStates, 
willCompleteSuccessfully());
+                    assertThat(globalPartitionStates, 
willCompleteSuccessfully());
 
-                    Map<ZonePartitionId, GlobalPartitionState> 
globalStateStates;
+                    Map<?, GlobalPartitionStateEnum> globalStateStates;
                     try {
                         globalStateStates = globalPartitionStates.get();
                     } catch (InterruptedException | ExecutionException e) {
                         throw new RuntimeException(e);
                     }
 
-                    return globalStateStates.entrySet()
+                    return globalStateStates.values()
                             .stream()
-                            .allMatch(partitionStateByNodes ->
-                                            
partitionStateByNodes.getValue().state == GlobalPartitionStateEnum.AVAILABLE
-                            );
+                            .allMatch(state -> state == 
GlobalPartitionStateEnum.AVAILABLE);
                 },
                 30_000
         ));

Reply via email to