IGNITE-2972 .NET: Fixed CacheQueriesTest.TestSqlQueryLocal sporadic failures. This closes #633.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6578c8b1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6578c8b1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6578c8b1 Branch: refs/heads/ignite-db-x-10884 Commit: 6578c8b1e2dc57861da7ce448bc9f752ddecdf3a Parents: 222f9c1 Author: Pavel Tupitsyn <[email protected]> Authored: Tue Apr 12 15:09:57 2016 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Tue Apr 12 15:09:57 2016 +0300 ---------------------------------------------------------------------- .../Cache/Query/CacheQueriesTest.cs | 13 ++++++------- .../Apache.Ignite.Core.Tests/Config/cache-query.xml | 2 ++ 2 files changed, 8 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/6578c8b1/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 8020649..6ed76678 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 @@ -27,7 +27,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Query using Apache.Ignite.Core.Cache; using Apache.Ignite.Core.Cache.Query; using Apache.Ignite.Core.Common; - using Apache.Ignite.Core.Impl; using Apache.Ignite.Core.Impl.Binary; using NUnit.Framework; @@ -399,8 +398,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query var exp = PopulateCache(cache, loc, cnt, x => x < 50); // 2. Validate results. - SqlQuery qry = loc ? new SqlQuery(typeof(QueryPerson), "age < 50", true) : - new SqlQuery(typeof(QueryPerson), "age < 50"); + var qry = new SqlQuery(typeof(QueryPerson), "age < 50", loc); ValidateQueryResults(cache, qry, exp, keepBinary); } @@ -666,7 +664,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Query var qry = new ScanQuery<int, TV> { Partition = part }; - Console.WriteLine("Checking query on partition " + part); ValidateQueryResults(cache, qry, exp0, keepBinary); } @@ -683,7 +680,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Query var qry = new ScanQuery<int, TV>(new ScanQueryFilter<TV>()) { Partition = part }; - Console.WriteLine("Checking predicate query on partition " + part); ValidateQueryResults(cache, qry, exp0, keepBinary); } @@ -831,14 +827,17 @@ namespace Apache.Ignite.Core.Tests.Cache.Query 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(100); cache.Put(val, new QueryPerson(val.ToString(), val)); - if (expectedEntryFilter(val) && (!loc || cache.Ignite.GetAffinity(cache.Name) - .IsPrimary(cache.Ignite.GetCluster().GetLocalNode(), val))) + if (expectedEntryFilter(val) && (!loc || aff.IsPrimary(localNode, val))) exp.Add(val); } http://git-wip-us.apache.org/repos/asf/ignite/blob/6578c8b1/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml index 08d36e2..b0dc48f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml @@ -28,6 +28,7 @@ <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"> <property name="localHost" value="127.0.0.1"/> <property name="connectorConfiguration"><null/></property> + <property name="lateAffinityAssignment" value="false"/> <property name="platformConfiguration"> <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration"> @@ -52,6 +53,7 @@ <bean class="org.apache.ignite.configuration.CacheConfiguration"> <property name="name" value="cache"/> <property name="cacheMode" value="PARTITIONED"/> + <property name="backups" value="0"/> <property name="atomicityMode" value="TRANSACTIONAL"/> <property name="writeSynchronizationMode" value="FULL_SYNC"/>
