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

mpetrov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new a6ed7fffc60 IGNITE-17836 Fixed flaky GridCache*FailoverSelfTests 
(#12763)
a6ed7fffc60 is described below

commit a6ed7fffc609919e5ce2d619fb5a4087e49a5c46
Author: Mikhail Petrov <[email protected]>
AuthorDate: Fri Feb 20 00:54:27 2026 +0300

    IGNITE-17836 Fixed flaky GridCache*FailoverSelfTests (#12763)
---
 .../processors/cache/GridCacheAbstractFailoverSelfTest.java | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
index e9c7db06a7a..fac3ccf9978 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
@@ -29,7 +29,6 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
-import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.internal.util.typedef.CA;
 import org.apache.ignite.internal.util.typedef.CIX1;
 import org.apache.ignite.internal.util.typedef.G;
@@ -156,6 +155,12 @@ public abstract class GridCacheAbstractFailoverSelfTest 
extends GridCacheAbstrac
 
         Ignite g = startGrid(NEW_IGNITE_INSTANCE_NAME);
 
+        // We need to wait for the local Cache Affinity Version to be updated 
on each node after the rebalance is complete.
+        // Otherwise, the IgniteCache#size() call may be made while the Cache 
Affinity Version change is still in process.
+        // It can lead to the situation when some nodes calculate the local 
cache size based on the updated Affinity version,
+        // while others relies on the old one. As a result, the 
IgniteCache#size() value will not match the expected value.
+        awaitPartitionMapExchange();
+
         check(cache(g), ENTRY_CNT);
 
         int half = ENTRY_CNT / 2;
@@ -374,11 +379,7 @@ public abstract class GridCacheAbstractFailoverSelfTest 
extends GridCacheAbstrac
      * @throws Exception If failed.
      */
     private void check(final IgniteCache<String, Integer> cache, final int 
expSize) throws Exception {
-        GridTestUtils.waitForCondition(new GridAbsPredicate() {
-            @Override public boolean apply() {
-                return cache.size() >= expSize;
-            }
-        }, 5000);
+        GridTestUtils.waitForCondition(() -> cache.size() >= expSize, 5000);
 
         int size = cache.size();
 

Reply via email to