use of io.questdb.cairo.vm.MemoryCMRImpl in project questdb by bluestreak01.
the class ExtendedOnePageMemoryTest method testFailOnGrow.
@Test
public void testFailOnGrow() throws IOException {
createFile();
try (MemoryMR mem = new MemoryCMRImpl()) {
int sz = FILE_SIZE / 2;
mem.of(ff, path, sz, sz, MemoryTag.MMAP_DEFAULT);
FILE_MAP_FAIL.set(true);
sz *= 2;
try {
mem.extend(sz);
Assert.fail();
} catch (CairoException ex) {
TestUtils.assertContains(ex.getFlyweightMessage(), "could not remap");
}
}
}
use of io.questdb.cairo.vm.MemoryCMRImpl in project questdb by bluestreak01.
the class ExtendedOnePageMemoryTest method testFailOnInitialMap.
@Test
public void testFailOnInitialMap() throws IOException {
createFile();
try (MemoryMR mem = new MemoryCMRImpl()) {
FILE_MAP_FAIL.set(true);
try {
mem.smallFile(ff, path, MemoryTag.MMAP_DEFAULT);
Assert.fail();
} catch (CairoException ex) {
TestUtils.assertContains(ex.getFlyweightMessage(), "could not mmap");
}
}
}
Aggregations