You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2018/10/30 14:00:02 UTC

ignite git commit: IGNITE-9769 Fixed flaky IgniteCacheAtomicProtocolTest.testPutReaderUpdate1 - Fixes #4897.

Repository: ignite
Updated Branches:
  refs/heads/master 223291be5 -> b424ef815


IGNITE-9769 Fixed flaky IgniteCacheAtomicProtocolTest.testPutReaderUpdate1 - Fixes #4897.

Signed-off-by: Alexey Goncharuk <al...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b424ef81
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b424ef81
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b424ef81

Branch: refs/heads/master
Commit: b424ef815bd12d1478d706ad10f62f2ce8ab24b7
Parents: 223291b
Author: Dmitrii Ryabov <So...@gmail.com>
Authored: Tue Oct 30 16:55:21 2018 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Oct 30 16:55:21 2018 +0300

----------------------------------------------------------------------
 .../dht/atomic/IgniteCacheAtomicProtocolTest.java         | 10 ++++++----
 .../junits/common/GridCommonAbstractTest.java             |  9 +++++++--
 2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b424ef81/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java
index 14c8571..66c04ea 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java
@@ -806,13 +806,15 @@ public class IgniteCacheAtomicProtocolTest extends GridCommonAbstractTest {
 
         startServers(2);
 
-        // Waiting for minor topology changing because of late affinity assignment.
-        awaitPartitionMapExchange();
-
         Ignite srv0 = ignite(0);
         Ignite srv1 = ignite(1);
 
-        List<Integer> keys = primaryKeys(srv0.cache(TEST_CACHE), putAll ? 3 : 1);
+        IgniteCache<Object, Object> cache = srv0.cache(TEST_CACHE);
+
+        // Waiting for minor topology changing because of late affinity assignment.
+        awaitPartitionMapExchange();
+
+        List<Integer> keys = primaryKeys(cache, putAll ? 3 : 1);
 
         ccfg = null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b424ef81/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index 7091a09..a06f15a 100755
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -670,7 +670,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
 
                             if (readyVer.topologyVersion() > 0 && c.context().started()) {
                                 // Must map on updated version of topology.
-                                Collection<ClusterNode> affNodes =
+                                List<ClusterNode> affNodes =
                                     dht.context().affinity().assignment(readyVer).idealAssignment().get(p);
 
                                 int affNodesCnt = affNodes.size();
@@ -684,8 +684,13 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
 
                                 GridDhtLocalPartition loc = top.localPartition(p, readyVer, false);
 
+                                boolean notPrimary = !affNodes.isEmpty() &&
+                                    !exchMgr.rebalanceTopologyVersion().equals(AffinityTopologyVersion.NONE) &&
+                                    !affNodes.get(0).equals(dht.context().affinity().primaryByPartition(p, readyVer));
+
                                 if (affNodesCnt != ownerNodesCnt || !affNodes.containsAll(owners) ||
-                                    (waitEvicts && loc != null && loc.state() != GridDhtPartitionState.OWNING)) {
+                                    (waitEvicts && loc != null && loc.state() != GridDhtPartitionState.OWNING) ||
+                                    notPrimary) {
                                     if (i % 50 == 0)
                                         LT.warn(log(), "Waiting for topology map update [" +
                                             "igniteInstanceName=" + g.name() +