ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [15/15] ignite git commit: fixing tests
Date Tue, 27 Oct 2015 11:13:01 GMT
fixing tests


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

Branch: refs/heads/ignite-1.4-slow-server-debug
Commit: 55a2798a127bf2fd0daf0f5be5bc2e5774a01976
Parents: baa18f9
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Tue Oct 27 14:12:18 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Tue Oct 27 14:12:18 2015 +0300

----------------------------------------------------------------------
 ...oncurrentLinkedHashMapMultiThreadedSelfTest.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/55a2798a/modules/core/src/test/java/org/apache/ignite/util/GridConcurrentLinkedHashMapMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/util/GridConcurrentLinkedHashMapMultiThreadedSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/util/GridConcurrentLinkedHashMapMultiThreadedSelfTest.java
index 35f6f97..9fe2690 100644
--- a/modules/core/src/test/java/org/apache/ignite/util/GridConcurrentLinkedHashMapMultiThreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/util/GridConcurrentLinkedHashMapMultiThreadedSelfTest.java
@@ -146,10 +146,12 @@ public class GridConcurrentLinkedHashMapMultiThreadedSelfTest extends
GridCommon
     public void testEvictPerSegment() throws Exception {
         info(">>> Test grid concurrent linked hash map...");
 
-        final int maxSize = 1000;
+        int concurLvl = 64;
+        final int maxSize = concurLvl * 30;
+        int diff = (int)(maxSize * 0.1);
 
         ConcurrentLinkedHashMap<Integer, String> linkedMap = new ConcurrentLinkedHashMap<>(
-            32, 0.75f, 64, maxSize, PER_SEGMENT_Q);
+            32, 0.75f, concurLvl, maxSize, PER_SEGMENT_Q);
 
         int keyCnt = 1000000;
 
@@ -159,8 +161,6 @@ public class GridConcurrentLinkedHashMapMultiThreadedSelfTest extends
GridCommon
             keyCnt,
             maxSize * 10); // Intentionally memorize more than maxSize since in this mode
LRU is not fair.
 
-        int diff = 10; // 1% of 1000.
-
         assertTrue("Invalid map size: " + linkedMap.size(), U.safeAbs(maxSize - linkedMap.size())
<= diff);
         assertTrue("Invalid map sizex: " + linkedMap.sizex(), U.safeAbs(maxSize - linkedMap.sizex())
<= diff);
 
@@ -208,10 +208,12 @@ public class GridConcurrentLinkedHashMapMultiThreadedSelfTest extends
GridCommon
     public void testEvictPerSegmentOptimizedRemoves() throws Exception {
         info(">>> Test grid concurrent linked hash map...");
 
-        final int maxSize = 1000;
+        int concurLvl = 64;
+        final int maxSize = concurLvl * 30;
+        int diff = (int)(maxSize * 0.1);
 
         ConcurrentLinkedHashMap<Integer, String> linkedMap = new ConcurrentLinkedHashMap<>(
-            32, 0.75f, 64, maxSize, PER_SEGMENT_Q_OPTIMIZED_RMV);
+            32, 0.75f, concurLvl, maxSize, PER_SEGMENT_Q_OPTIMIZED_RMV);
 
         int keyCnt = 1000000;
 
@@ -221,8 +223,6 @@ public class GridConcurrentLinkedHashMapMultiThreadedSelfTest extends
GridCommon
             keyCnt,
             maxSize * 10); // Intentionally memorize more than maxSize since in this mode
LRU is not fair.
 
-        int diff = 10; // 1% of 1000.
-
         assertTrue("Invalid map size: " + linkedMap.size(), U.safeAbs(maxSize - linkedMap.size())
<= diff);
         assertTrue("Invalid map sizex: " + linkedMap.sizex(), U.safeAbs(maxSize - linkedMap.sizex())
<= diff);
 


Mime
View raw message