use of org.apache.ignite.testframework.junits.WithSystemProperty in project ignite by apache.
the class IgniteWalHistoryReservationsTest method testCheckpointsNotReserveWithWalModeNone.
/**
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_PDS_WAL_REBALANCE_THRESHOLD, value = "0")
public void testCheckpointsNotReserveWithWalModeNone() throws Exception {
walMode = WALMode.NONE;
IgniteEx grid = startGrids(2);
grid.cluster().active(true);
IgniteCache<Object, Object> cache = grid.createCache(new CacheConfiguration<>("cache").setBackups(1));
for (int i = 0; i < 1000; i++) cache.put(i, i);
stopGrid(1);
for (int i = 1000; i < 2000; i++) cache.put(i, i);
startGrid(1);
}
use of org.apache.ignite.testframework.junits.WithSystemProperty in project ignite by apache.
the class PerformanceStatisticsPropertiesTest method testCachedStringsThreshold.
/**
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_PERF_STAT_CACHED_STRINGS_THRESHOLD, value = "" + TEST_CACHED_STRINGS_THRESHOLD)
public void testCachedStringsThreshold() throws Exception {
int tasksCnt = TEST_CACHED_STRINGS_THRESHOLD * 2;
int executions = 2;
startCollectStatistics();
int expLen = 0;
for (int i = 0; i < tasksCnt; i++) {
String taskName = "TestTask-" + i;
if (i < TEST_CACHED_STRINGS_THRESHOLD - 1 - srv.context().cache().cacheDescriptors().values().size()) {
expLen += taskRecordSize(taskName.getBytes().length, false) + jobRecordSize() + (taskRecordSize(0, true) + jobRecordSize()) * (executions - 1);
} else
expLen += (taskRecordSize(taskName.getBytes().length, false) + jobRecordSize()) * executions;
expLen += /*typeOp*/
2 * executions;
for (int j = 0; j < executions; j++) {
srv.compute().withName(taskName).run(new IgniteRunnable() {
@Override
public void run() {
// No-op.
}
});
}
}
AtomicInteger tasks = new AtomicInteger();
stopCollectStatisticsAndRead(new TestHandler() {
@Override
public void task(UUID nodeId, IgniteUuid sesId, String taskName, long startTime, long duration, int affPartId) {
tasks.incrementAndGet();
}
});
assertEquals(tasksCnt * executions, tasks.get());
// Started caches.
expLen += srv.context().cache().cacheDescriptors().values().stream().mapToInt(desc -> 1 + cacheStartRecordSize(desc.cacheName().getBytes().length, false)).sum();
List<File> files = statisticsFiles();
assertEquals(1, files.size());
assertEquals(expLen, files.get(0).length());
}
use of org.apache.ignite.testframework.junits.WithSystemProperty in project ignite by apache.
the class DistributedMetaStoragePersistentTest method testJoinDirtyNodeFullData.
/**
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_GLOBAL_METASTORAGE_HISTORY_MAX_BYTES, value = "0")
public void testJoinDirtyNodeFullData() throws Exception {
IgniteEx ignite = startGrid(0);
startGrid(1);
ignite.cluster().active(true);
ignite.context().distributedMetastorage().write("key1", "value1");
stopGrid(1);
stopGrid(0);
ignite = startGrid(0);
ignite.cluster().active(true);
ignite.context().distributedMetastorage().write("key2", "value2");
ignite.context().distributedMetastorage().write("key3", "value3");
IgniteEx newNode = startGrid(1);
assertEquals("value1", newNode.context().distributedMetastorage().read("key1"));
assertEquals("value2", newNode.context().distributedMetastorage().read("key2"));
assertEquals("value3", newNode.context().distributedMetastorage().read("key3"));
assertDistributedMetastoragesAreEqual(ignite, newNode);
}
use of org.apache.ignite.testframework.junits.WithSystemProperty in project ignite by apache.
the class DistributedMetaStoragePersistentTest method testJoinNodeWithoutEnoughHistory.
/**
* @throws Exception If failed.
*/
@Test
@Ignore
@WithSystemProperty(key = IGNITE_GLOBAL_METASTORAGE_HISTORY_MAX_BYTES, value = "0")
public void testJoinNodeWithoutEnoughHistory() throws Exception {
IgniteEx ignite = startGrid(0);
startGrid(1);
ignite.cluster().active(true);
ignite.context().distributedMetastorage().write("key1", "value1");
stopGrid(1);
ignite.context().distributedMetastorage().write("key2", "value2");
ignite.context().distributedMetastorage().write("key3", "value3");
stopGrid(0);
ignite = startGrid(1);
startGrid(0);
awaitPartitionMapExchange();
assertEquals("value1", ignite.context().distributedMetastorage().read("key1"));
assertEquals("value2", ignite.context().distributedMetastorage().read("key2"));
assertEquals("value3", ignite.context().distributedMetastorage().read("key3"));
assertDistributedMetastoragesAreEqual(ignite, grid(0));
}
use of org.apache.ignite.testframework.junits.WithSystemProperty in project ignite by apache.
the class DistributedMetaStorageTest method testJoinCleanNodeFullData.
/**
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_GLOBAL_METASTORAGE_HISTORY_MAX_BYTES, value = "0")
public void testJoinCleanNodeFullData() throws Exception {
IgniteEx ignite = startGrid(0);
ignite.cluster().active(true);
ignite.context().distributedMetastorage().write("key1", "value1");
ignite.context().distributedMetastorage().write("key2", "value2");
startGrid(1);
assertEquals("value1", metastorage(1).read("key1"));
assertEquals("value2", metastorage(1).read("key2"));
assertDistributedMetastoragesAreEqual(ignite, grid(1));
}
Aggregations