fix test bug: don't use RAMDirectory when sorting 100 MB worth of data

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1709060 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-10-16 17:16:33 +00:00
parent 91a6c31d77
commit a7aff1bc43
1 changed files with 9 additions and 1 deletions

View File

@ -62,6 +62,14 @@ public class TestOfflineSorter extends LuceneTestCase {
return dir;
}
private static Directory newFSDirectoryNoVirusScanner() {
Directory dir = newFSDirectory(createTempDir());
if (dir instanceof MockDirectoryWrapper) {
((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
}
return dir;
}
public void testEmpty() throws Exception {
try (Directory dir = newDirectoryNoVirusScanner()) {
checkSort(dir, new OfflineSorter(dir, "foo"), new byte [][] {});
@ -97,7 +105,7 @@ public class TestOfflineSorter extends LuceneTestCase {
@Nightly
public void testLargerRandom() throws Exception {
// Sort 100MB worth of data with 15mb buffer.
try (Directory dir = newDirectoryNoVirusScanner()) {
try (Directory dir = newFSDirectoryNoVirusScanner()) {
checkSort(dir, new OfflineSorter(dir, "foo", OfflineSorter.DEFAULT_COMPARATOR, BufferSize.megabytes(16), OfflineSorter.MAX_TEMPFILES),
generateRandom((int)OfflineSorter.MB * 100));
}