ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [42/51] [abbrv] incubator-ignite git commit: # IGNITE-56 Fix test hanging. (cherry picked from commit cabc840)
Date Tue, 10 Feb 2015 08:17:06 GMT
# IGNITE-56 Fix test hanging.
(cherry picked from commit cabc840)


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

Branch: refs/heads/ignite-96-tests
Commit: 35b4bc24f4adfd31b2abe57dc0f2629cf7ce2e7f
Parents: fc0eceb
Author: sevdokimov <sergey.evdokimov@jetbrains.com>
Authored: Mon Feb 9 21:36:36 2015 +0300
Committer: sevdokimov <sergey.evdokimov@jetbrains.com>
Committed: Mon Feb 9 21:39:58 2015 +0300

----------------------------------------------------------------------
 .../dht/GridCacheDhtPreloadPutGetSelfTest.java  | 45 +++++++++++---------
 1 file changed, 24 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/35b4bc24/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPutGetSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPutGetSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPutGetSelfTest.java
index a186238..c91b94a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPutGetSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPutGetSelfTest.java
@@ -222,38 +222,41 @@ public class GridCacheDhtPreloadPutGetSelfTest extends GridCommonAbstractTest
{
             IgniteInternalFuture fut2 = GridTestUtils.runMultiThreadedAsync(
                 new Callable<Object>() {
                     @Nullable @Override public Object call() throws Exception {
-                        writeLatch.await();
+                        try {
+                            writeLatch.await(10, TimeUnit.SECONDS);
 
-                        Ignite g1 = startGrid(1);
+                            Ignite g1 = startGrid(1);
 
-                        GridCache<Integer, Integer> cache = g1.cache(null);
+                            GridCache<Integer, Integer> cache = g1.cache(null);
 
-                        for (int j = 0; j < KEY_CNT; j++) {
-                            cache.put(j, j);
-
-                            if (j % FREQUENCY == 0)
-                                info("Stored value in cache: " + j);
-                        }
+                            for (int j = 0; j < KEY_CNT; j++) {
+                                cache.put(j, j);
 
-                        done.set(true);
+                                if (j % FREQUENCY == 0)
+                                    info("Stored value in cache: " + j);
+                            }
 
-                        for (int j = 0; j < KEY_CNT; j++) {
-                            Cache.Entry<Integer, Integer> entry = cache.entry(j);
+                            done.set(true);
 
-                            assert entry != null;
+                            for (int j = 0; j < KEY_CNT; j++) {
+                                Cache.Entry<Integer, Integer> entry = cache.entry(j);
 
-                            Integer val = entry.getValue();
+                                assert entry != null;
 
-                            if (j % FREQUENCY == 0)
-                                info("Read entry: " + entry.getKey() + " -> " + val);
+                                Integer val = entry.getValue();
 
-                            assert val != null && val == j;
-                        }
+                                if (j % FREQUENCY == 0)
+                                    info("Read entry: " + entry.getKey() + " -> " + val);
 
-                        if (backups > 0)
-                            stopGrid(1);
+                                assert val != null && val == j;
+                            }
 
-                        readLatch.countDown();
+                            if (backups > 0)
+                                stopGrid(1);
+                        }
+                        finally {
+                            readLatch.countDown();
+                        }
 
                         return null;
                     }


Mime
View raw message