ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [47/50] [abbrv] incubator-ignite git commit: # ignite-23
Date Wed, 27 May 2015 16:14:06 GMT
# ignite-23


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

Branch: refs/heads/ignite-943
Commit: 9188f4ed312d4a0289a3c2b63ebe478341be6424
Parents: cf6c420
Author: sboikov <sboikov@gridgain.com>
Authored: Wed May 27 16:51:07 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed May 27 17:01:14 2015 +0300

----------------------------------------------------------------------
 ...niteCacheClientNodeChangingTopologyTest.java | 29 ++++++++++++++++++--
 .../junits/common/GridCommonAbstractTest.java   |  2 +-
 2 files changed, 27 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9188f4ed/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
index e13b283..47c1d7e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
@@ -29,6 +29,7 @@ import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
 import org.apache.ignite.internal.processors.cache.distributed.near.*;
 import org.apache.ignite.internal.processors.cache.version.*;
+import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.plugin.extensions.communication.*;
@@ -851,8 +852,8 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
         ccfg.setRebalanceMode(SYNC);
         ccfg.setNearConfiguration(nearCfg);
 
-        IgniteEx ignite0 = startGrid(0);
-        IgniteEx ignite1 = startGrid(1);
+        final IgniteEx ignite0 = startGrid(0);
+        final IgniteEx ignite1 = startGrid(1);
 
         client = true;
 
@@ -920,10 +921,32 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
 
         lockFut.get();
 
+        boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+            @Override public boolean apply() {
+                return unlocked(ignite0) && unlocked(ignite1);
+            }
+
+            private boolean unlocked(Ignite ignite) {
+                IgniteCache<Integer, Integer> cache = ignite.cache(null);
+
+                for (Integer key : keys) {
+                    if (cache.isLocalLocked(key, false)) {
+                        log.info("Key is locked [key=" + key + ", node=" + ignite.name()
+ ']');
+
+                        return false;
+                    }
+                }
+
+                return true;
+            }
+        }, 10_000);
+
+        assertTrue(wait);
+
         for (Integer key : keys) {
             Lock lock = cache0.lock(key);
 
-            assertTrue(lock.tryLock());
+            assertTrue("Failed to lock: " + key, lock.tryLock());
 
             lock.unlock();
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9188f4ed/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 a4d3355..1f4c7b6 100644
--- 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
@@ -391,7 +391,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
                                 if (i == 0)
                                     start = System.currentTimeMillis();
 
-                                if (i >= 50)
+                                if (System.currentTimeMillis() - start > 30_000)
                                     throw new IgniteException("Timeout of waiting for topology
map update [grid="
                                         + g.name() + ", p=" + p + ", nodes=" + exp + ", owners="
+ actual +
                                             ", affNodes=" + affNodes + ", owners=" + owners
+ ", locNode="


Mime
View raw message