ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [13/47] incubator-ignite git commit: # sprint-1 Fixed test to avoid hang
Date Thu, 29 Jan 2015 11:45:35 GMT
# sprint-1 Fixed test to avoid hang


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

Branch: refs/heads/ignite-69
Commit: 22860972ba4e74edb5472e81d7e5cc498c0355f4
Parents: c6e4f45
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Jan 29 09:27:32 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Jan 29 09:27:32 2015 +0300

----------------------------------------------------------------------
 .../ipc/shmem/GridIpcSharedMemorySpaceSelfTest.java   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22860972/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemorySpaceSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemorySpaceSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemorySpaceSelfTest.java
index 1d24f02..fac8c9b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemorySpaceSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemorySpaceSelfTest.java
@@ -18,7 +18,9 @@
 package org.apache.ignite.internal.util.ipc.shmem;
 
 import org.apache.ignite.*;
+import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.common.*;
 import org.jdk8.backport.*;
 
@@ -103,9 +105,15 @@ public class GridIpcSharedMemorySpaceSelfTest extends GridCommonAbstractTest
{
                 @Override public Object call() throws Exception {
                     GridIpcSharedMemorySpace inSpace;
 
-                    while ((inSpace = spaceRef.get()) == null) {
-                        // No-op;
-                    }
+                    GridTestUtils.waitForCondition(new GridAbsPredicate() {
+                        @Override public boolean apply() {
+                            return spaceRef.get() != null;
+                        }
+                    }, 10_000);
+
+                    inSpace = spaceRef.get();
+
+                    assertNotNull(inSpace);
 
                     try (GridIpcSharedMemorySpace space = new GridIpcSharedMemorySpace(tok,
0, 0, 128, true,
                         inSpace.sharedMemoryId(), log)) {


Mime
View raw message