use of org.neo4j.adversaries.pagecache.AdversarialPagedFile in project neo4j by neo4j.
the class PageCacheTest method readableByteChannelMustReadAllBytesInFileConsistently.
@RepeatRule.Repeat(times = 20)
@Test(timeout = SHORT_TIMEOUT_MILLIS)
public void readableByteChannelMustReadAllBytesInFileConsistently() throws Exception {
File file = file("a");
generateFileWithRecords(file, recordCount, recordSize);
configureStandardPageCache();
try (PagedFile pf = pageCache.map(file, filePageSize)) {
RandomAdversary adversary = new RandomAdversary(0.9, 0, 0);
AdversarialPagedFile apf = new AdversarialPagedFile(pf, adversary);
try (ReadableByteChannel channel = apf.openReadableByteChannel()) {
verifyRecordsInFile(channel, recordCount);
}
}
}
Aggregations