You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/01/09 10:37:46 UTC
ignite git commit: CacheLoadingConcurrentGridStartSelfTest: changed
test to wait for data loading.
Repository: ignite
Updated Branches:
refs/heads/ignite-3477 a74d5ee23 -> 57a002ad0
CacheLoadingConcurrentGridStartSelfTest: changed test to wait for data loading.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/57a002ad
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/57a002ad
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/57a002ad
Branch: refs/heads/ignite-3477
Commit: 57a002ad01d170d6219804430449b133a912a433
Parents: a74d5ee
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jan 9 13:37:52 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jan 9 13:37:52 2017 +0300
----------------------------------------------------------------------
...CacheLoadingConcurrentGridStartSelfTest.java | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/57a002ad/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
index ce64e1d..df4c196 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
@@ -36,6 +36,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.lang.GridAbsPredicate;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.internal.util.typedef.P1;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -346,9 +347,22 @@ public class CacheLoadingConcurrentGridStartSelfTest extends GridCommonAbstractT
assertCacheSize();
}
- /** Asserts cache size. */
- protected void assertCacheSize() {
- IgniteCache<Integer, String> cache = grid(0).cache(null);
+ /**
+ * @throws Exception If failed.
+ */
+ private void assertCacheSize() throws Exception {
+ final IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ int size = cache.size(CachePeekMode.PRIMARY);
+
+ if (size != KEYS_CNT)
+ log.info("Cache size: " + size);
+
+ return size == KEYS_CNT;
+ }
+ }, 2 * 60_000);
assertEquals("Data lost.", KEYS_CNT, cache.size(CachePeekMode.PRIMARY));