Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2FAFC200C56 for ; Fri, 14 Apr 2017 09:40:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2E34B160B8C; Fri, 14 Apr 2017 07:40:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 735FF160B80 for ; Fri, 14 Apr 2017 09:40:13 +0200 (CEST) Received: (qmail 84354 invoked by uid 500); 14 Apr 2017 07:40:12 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 84345 invoked by uid 99); 14 Apr 2017 07:40:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Apr 2017 07:40:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6B9FCDFC31; Fri, 14 Apr 2017 07:40:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ptupitsyn@apache.org To: commits@ignite.apache.org Message-Id: <2dd3bab660ce4ebd8539b5aeff4c205b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: .NET: Fix metrics test (IGNITE-3018) Date: Fri, 14 Apr 2017 07:40:12 +0000 (UTC) archived-at: Fri, 14 Apr 2017 07:40:14 -0000 Repository: ignite Updated Branches: refs/heads/master 428f66d38 -> 40347eda8 .NET: Fix metrics test (IGNITE-3018) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/40347eda Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/40347eda Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/40347eda Branch: refs/heads/master Commit: 40347eda88de4c48a2c0535e50a91c5bff683105 Parents: 428f66d Author: Pavel Tupitsyn Authored: Fri Apr 14 10:40:04 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Apr 14 10:40:04 2017 +0300 ---------------------------------------------------------------------- .../Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/40347eda/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs index d1d6c7b..d12afd2 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs @@ -25,6 +25,7 @@ namespace Apache.Ignite.Core.Tests.Cache using Apache.Ignite.Core.Impl; using Apache.Ignite.Core.Impl.Cache; using NUnit.Framework; + using System.Linq; /// /// Tests cache metrics propagation. @@ -212,7 +213,8 @@ namespace Apache.Ignite.Core.Tests.Cache { func2 = func2 ?? func; - var localCache = Ignition.GetIgnite().CreateCache(new CacheConfiguration(cacheName) + var localIgnite = Ignition.GetIgnite(); + var localCache = localIgnite.CreateCache(new CacheConfiguration(cacheName) { EnableStatistics = true }); @@ -222,9 +224,12 @@ namespace Apache.Ignite.Core.Tests.Cache Assert.IsTrue(localCache.GetConfiguration().EnableStatistics); Assert.IsTrue(remoteCache.GetConfiguration().EnableStatistics); - localCache.Put(1, 1); - localCache.Get(1); - + var aff = localIgnite.GetAffinity(cacheName); + var localNode = localIgnite.GetCluster().GetLocalNode(); + var localKey = Enumerable.Range(1, 10000).First(x => aff.IsPrimary(localNode, x)); + + localCache.Put(localKey, 1); + localCache.Get(localKey); // Wait for metrics to propagate. Thread.Sleep(TcpDiscoverySpi.DefaultHeartbeatFrequency);