IGNITE-5717 .NET: Reduce MemoryPolicyConfiguration.MaxSize for persistence 
tests as a workaround for OOM on default settings


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

Branch: refs/heads/ignite-2.1
Commit: a9387adef490086406b05fe961ff0f3151045caa
Parents: d232648
Author: Pavel Tupitsyn <ptupit...@apache.org>
Authored: Fri Jul 7 15:21:20 2017 +0300
Committer: Pavel Tupitsyn <ptupit...@apache.org>
Committed: Fri Jul 7 15:21:20 2017 +0300

----------------------------------------------------------------------
 .../Cache/PersistentStoreTest.cs                | 36 ++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a9387ade/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs
----------------------------------------------------------------------
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs
 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs
index 96ae47c..e9cbce8 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs
@@ -18,6 +18,7 @@
 namespace Apache.Ignite.Core.Tests.Cache
 {
     using System.IO;
+    using Apache.Ignite.Core.Cache.Configuration;
     using Apache.Ignite.Core.Common;
     using Apache.Ignite.Core.Impl;
     using Apache.Ignite.Core.PersistentStore;
@@ -51,7 +52,7 @@ namespace Apache.Ignite.Core.Tests.Cache
         [Test]
         public void TestCacheDataSurvivesNodeRestart()
         {
-            var cfg = new IgniteConfiguration(TestUtils.GetTestConfiguration())
+            var cfg = new IgniteConfiguration(GetTestConfiguration())
             {
                 PersistentStoreConfiguration = new PersistentStoreConfiguration
                 {
@@ -106,7 +107,7 @@ namespace Apache.Ignite.Core.Tests.Cache
         [Test]
         public void TestGridActivationWithPersistence()
         {
-            var cfg = new IgniteConfiguration(TestUtils.GetTestConfiguration())
+            var cfg = new IgniteConfiguration(GetTestConfiguration())
             {
                 PersistentStoreConfiguration = new 
PersistentStoreConfiguration()
             };
@@ -177,5 +178,36 @@ namespace Apache.Ignite.Core.Tests.Cache
                     ex.Message.Substring(0, 62));
             }
         }
+
+        /// <summary>
+        /// Gets the test configuration.
+        /// </summary>
+        private static IgniteConfiguration GetTestConfiguration()
+        {
+            return new IgniteConfiguration(TestUtils.GetTestConfiguration())
+            {
+                MemoryConfiguration = GetMemoryConfig()
+            };
+        }
+
+        /// <summary>
+        /// Gets the memory configuration with reduced MaxMemory to work 
around persistence bug.
+        /// </summary>
+        private static MemoryConfiguration GetMemoryConfig()
+        {
+            // TODO: Remove this method and use default config (IGNITE-5717).
+            return new MemoryConfiguration
+            {
+                MemoryPolicies = new[]
+                {
+                    new MemoryPolicyConfiguration
+                    {
+                        Name = 
MemoryConfiguration.DefaultDefaultMemoryPolicyName,
+                        InitialSize = 512*1024*1024,
+                        MaxSize = 512*1024*1024
+                    }
+                }
+            };
+        }
     }
 }

Reply via email to