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/04/18 15:04:37 UTC

[38/46] ignite git commit: .NET: Fix resource cleanup in AffinityFunctionTest

.NET: Fix resource cleanup in AffinityFunctionTest


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

Branch: refs/heads/ignite-1561-1
Commit: 4c64568ee7029dc1602bb666b0fe137bcb9752d7
Parents: 3b93f79
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Apr 18 15:00:39 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Apr 18 15:00:39 2017 +0300

----------------------------------------------------------------------
 .../Cache/Affinity/AffinityFunctionTest.cs      | 25 ++++++++++++--------
 1 file changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4c64568e/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionTest.cs
index a5f07ca..404094d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionTest.cs
@@ -91,18 +91,23 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
         [TestFixtureTearDown]
         public void FixtureTearDown()
         {
-            // Check that affinity handles are present
-            TestUtils.AssertHandleRegistryHasItems(_ignite, _ignite.GetCacheNames().Count - 3, 0);
-            TestUtils.AssertHandleRegistryHasItems(_ignite2, _ignite.GetCacheNames().Count - 3, 0);
-
-            // Destroy all caches
-            _ignite.GetCacheNames().ToList().ForEach(_ignite.DestroyCache);
-            Assert.AreEqual(0, _ignite.GetCacheNames().Count);
+            try
+            {
+                // Check that affinity handles are present
+                TestUtils.AssertHandleRegistryHasItems(_ignite, _ignite.GetCacheNames().Count - 3, 0);
+                TestUtils.AssertHandleRegistryHasItems(_ignite2, _ignite.GetCacheNames().Count - 3, 0);
 
-            // Check that all affinity functions got released
-            TestUtils.AssertHandleRegistryIsEmpty(1000, _ignite, _ignite2);
+                // Destroy all caches
+                _ignite.GetCacheNames().ToList().ForEach(_ignite.DestroyCache);
+                Assert.AreEqual(0, _ignite.GetCacheNames().Count);
 
-            Ignition.StopAll(true);
+                // Check that all affinity functions got released
+                TestUtils.AssertHandleRegistryIsEmpty(1000, _ignite, _ignite2);
+            }
+            finally 
+            {
+                Ignition.StopAll(true);
+            }
         }
 
         /// <summary>