Search in sources :

Example 6 with RandomPageCacheTestHarness

use of org.neo4j.io.pagecache.randomharness.RandomPageCacheTestHarness in project neo4j by neo4j.

the class PageCacheHarnessTest method concurrentFlushingMustNotPutInterleavedDataIntoFile.

@Test(timeout = LONG_TIMEOUT_MILLIS)
public void concurrentFlushingMustNotPutInterleavedDataIntoFile() throws Exception {
    final RecordFormat recordFormat = new StandardRecordFormat();
    final int filePageCount = 2_000;
    try (RandomPageCacheTestHarness harness = new RandomPageCacheTestHarness()) {
        harness.setConcurrencyLevel(16);
        harness.setUseAdversarialIO(false);
        harness.setCachePageCount(filePageCount / 2);
        harness.setFilePageCount(filePageCount);
        harness.setCachePageSize(pageCachePageSize);
        harness.setFilePageSize(pageCachePageSize);
        harness.setInitialMappedFiles(3);
        harness.setCommandCount(15_000);
        harness.setFileSystem(fs);
        harness.disableCommands(MapFile, UnmapFile, ReadRecord, ReadMulti);
        harness.setVerification(filesAreCorrectlyWrittenVerification(recordFormat, filePageCount));
        harness.run(LONG_TIMEOUT_MILLIS, MILLISECONDS);
    }
}
Also used : RandomPageCacheTestHarness(org.neo4j.io.pagecache.randomharness.RandomPageCacheTestHarness) RecordFormat(org.neo4j.io.pagecache.randomharness.RecordFormat) PageCountRecordFormat(org.neo4j.io.pagecache.randomharness.PageCountRecordFormat) StandardRecordFormat(org.neo4j.io.pagecache.randomharness.StandardRecordFormat) StandardRecordFormat(org.neo4j.io.pagecache.randomharness.StandardRecordFormat) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 RandomPageCacheTestHarness (org.neo4j.io.pagecache.randomharness.RandomPageCacheTestHarness)6 StandardRecordFormat (org.neo4j.io.pagecache.randomharness.StandardRecordFormat)5 PageCountRecordFormat (org.neo4j.io.pagecache.randomharness.PageCountRecordFormat)4 RecordFormat (org.neo4j.io.pagecache.randomharness.RecordFormat)4 File (java.io.File)1 TimeUnit (java.util.concurrent.TimeUnit)1 Ignore (org.junit.Ignore)1 PageCursor (org.neo4j.io.pagecache.PageCursor)1 PagedFile (org.neo4j.io.pagecache.PagedFile)1 FlushFile (org.neo4j.io.pagecache.randomharness.Command.FlushFile)1 MapFile (org.neo4j.io.pagecache.randomharness.Command.MapFile)1 UnmapFile (org.neo4j.io.pagecache.randomharness.Command.UnmapFile)1