don't do random() per byte in this test

This commit is contained in:
Mike McCandless 2016-08-12 16:01:13 -04:00
parent 48cc599936
commit f485d29cad
1 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@ package org.apache.lucene.store;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Random;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
// import org.junit.Ignore; // import org.junit.Ignore;
@ -47,8 +48,9 @@ public class TestMmapDirectory extends BaseDirectoryTestCase {
for (int iter = 0; iter < 10; iter++) { for (int iter = 0; iter < 10; iter++) {
Directory dir = getDirectory(createTempDir("testAceWithThreads")); Directory dir = getDirectory(createTempDir("testAceWithThreads"));
IndexOutput out = dir.createOutput("test", IOContext.DEFAULT); IndexOutput out = dir.createOutput("test", IOContext.DEFAULT);
Random random = random();
for (int i = 0; i < 8 * 1024 * 1024; i++) { for (int i = 0; i < 8 * 1024 * 1024; i++) {
out.writeInt(random().nextInt()); out.writeInt(random.nextInt());
} }
out.close(); out.close();
IndexInput in = dir.openInput("test", IOContext.DEFAULT); IndexInput in = dir.openInput("test", IOContext.DEFAULT);