ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [02/10] ignite git commit: IGNITE-5446 Always use late affinity assignment mode - fix .NET tests
Date Wed, 12 Jul 2017 06:48:02 GMT
 IGNITE-5446 Always use late affinity assignment mode - fix .NET tests


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

Branch: refs/heads/ignite-2.1
Commit: a9ae95342dd566b210fe835221214ecc67e6ed16
Parents: c5966dd
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Tue Jul 11 14:13:14 2017 +0300
Committer: Pavel Tupitsyn <ptupitsyn@apache.org>
Committed: Tue Jul 11 14:13:14 2017 +0300

----------------------------------------------------------------------
 .../Cache/Query/CacheQueriesTest.cs             | 22 ++++++--------------
 1 file changed, 6 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a9ae9534/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
index 4df12a4..62c8230 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
@@ -379,12 +379,13 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
             var exp = PopulateCache(cache, loc, cnt, x => x < 50);
 
             // 2. Validate results.
-            var qry = new SqlFieldsQuery("SELECT name, age FROM QueryPerson WHERE age <
50", loc)
+            var qry = new SqlFieldsQuery("SELECT name, age FROM QueryPerson WHERE age <
50")
             {
                 EnableDistributedJoins = distrJoin,
                 EnforceJoinOrder = enforceJoinOrder,
                 Colocated = !distrJoin,
                 ReplicatedOnly = false,
+                Local = loc,
                 Timeout = TimeSpan.FromSeconds(2)
             };
 
@@ -891,29 +892,18 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
         {
             var rand = new Random();
 
-            var exp = new HashSet<int>();
-
-            var aff = cache.Ignite.GetAffinity(cache.Name);
-
-            var localNode = cache.Ignite.GetCluster().GetLocalNode();
-
             for (var i = 0; i < cnt; i++)
             {
                 var val = rand.Next(cnt);
 
                 cache.Put(val, new QueryPerson(val.ToString(), val));
-
-                if (expectedEntryFilter(val) && (!loc || aff.IsPrimary(localNode,
val)))
-                    exp.Add(val);
             }
 
-            if (loc)
-            {
-                Assert.AreEqual(exp.Count,
-                    cache.GetLocalEntries(CachePeekMode.Primary).Count(x => expectedEntryFilter(x.Key)));
-            }
+            var entries = loc
+                ? cache.GetLocalEntries(CachePeekMode.Primary)
+                : cache;
 
-            return exp;
+            return new HashSet<int>(entries.Select(x => x.Key).Where(expectedEntryFilter));
         }
     }
 


Mime
View raw message