ignite-gg-12163 fix testWalDirectOutOfMemory
@@ -4,6 +4,8 @@ import javax.cache.CacheException;
import org.apache.ignite.IgniteDataStreamer;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.MemoryConfiguration;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
import org.apache.ignite.configuration.PersistenceConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.processors.cache.database.wal.FileWriteAheadLogManager;
@@ -28,6 +30,18 @@ public class IgnitePersistentStoreWalTlbSelfTest extends GridCommonAbstractTest
cfg.setCacheConfiguration(ccfg);
+ MemoryConfiguration memCfg = new MemoryConfiguration();
+
+ MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
+
+ memPlcCfg.setName("dfltMemPlc");
+ memPlcCfg.setSize(100 * 1024 * 1024);
+
+ memCfg.setMemoryPolicies(memPlcCfg);
+ memCfg.setDefaultMemoryPolicyName("dfltMemPlc");
+
+ cfg.setMemoryConfiguration(memCfg);
+
cfg.setPersistenceConfiguration(new PersistenceConfiguration());
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
@@ -77,8 +91,8 @@ public class IgnitePersistentStoreWalTlbSelfTest extends GridCommonAbstractTest
* @throws Exception if failed.
*/
public void testWalDirectOutOfMemory() throws Exception {
-
IgniteEx ig = grid(1);
+
boolean locked = true;
try {
@@ -89,13 +103,15 @@ public class IgnitePersistentStoreWalTlbSelfTest extends GridCommonAbstractTest
if (i > 0 && i % 10_000 == 0)
info("Done put: " + i);
}
- } catch (CacheException ignore) {
+ }
+ catch (CacheException ignore) {
// expected
locked = false;
- } finally {
+ }
+ finally {
assertFalse(locked);
+
stopAllGrids();
}
}
-
}
