analysis test speedups

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1642002 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2014-11-27 02:06:05 +00:00
parent 66c61e9712
commit c2c106befa
6 changed files with 10 additions and 4 deletions

View File

@ -246,6 +246,7 @@ public class TestBugInSomething extends BaseTokenStreamTestCase {
}
// LUCENE-5269
@Slow
public void testUnicodeShinglesAndNgrams() throws Exception {
Analyzer analyzer = new Analyzer() {
@Override

View File

@ -900,7 +900,7 @@ public class TestRandomChains extends BaseTokenStreamTestCase {
}
public void testRandomChains() throws Throwable {
int numIterations = atLeast(20);
int numIterations = TEST_NIGHTLY ? atLeast(20) : 3;
Random random = random();
for (int i = 0; i < numIterations; i++) {
MockRandomAnalyzer a = new MockRandomAnalyzer(random.nextLong());
@ -919,7 +919,7 @@ public class TestRandomChains extends BaseTokenStreamTestCase {
// we might regret this decision...
public void testRandomChainsWithLargeStrings() throws Throwable {
int numIterations = atLeast(20);
int numIterations = TEST_NIGHTLY ? atLeast(20) : 3;
Random random = random();
for (int i = 0; i < numIterations; i++) {
MockRandomAnalyzer a = new MockRandomAnalyzer(random.nextLong());

View File

@ -355,7 +355,7 @@ public class TestWordDelimiterFilter extends BaseTokenStreamTestCase {
}
};
// TODO: properly support positionLengthAttribute
checkRandomData(random(), a, 1000*RANDOM_MULTIPLIER, 20, false, false);
checkRandomData(random(), a, 200*RANDOM_MULTIPLIER, 20, false, false);
}
}
@ -380,7 +380,7 @@ public class TestWordDelimiterFilter extends BaseTokenStreamTestCase {
}
};
// TODO: properly support positionLengthAttribute
checkRandomData(random(), a, 100*RANDOM_MULTIPLIER, 8192, false, false);
checkRandomData(random(), a, 20*RANDOM_MULTIPLIER, 8192, false, false);
}
}

View File

@ -32,6 +32,7 @@ import org.apache.lucene.util.TestUtil;
public class TestStandardAnalyzer extends BaseTokenStreamTestCase {
// LUCENE-5897: slow tokenization of strings of the form (\p{WB:ExtendNumLet}[\p{WB:Format}\p{WB:Extend}]*)+
@Slow
public void testLargePartiallyMatchingToken() throws Exception {
// TODO: get these lists of chars matching a property from ICU4J
// http://www.unicode.org/Public/6.3.0/ucd/auxiliary/WordBreakProperty.txt

View File

@ -41,6 +41,7 @@ import java.util.Random;
public class TestUAX29URLEmailTokenizer extends BaseTokenStreamTestCase {
// LUCENE-5440: extremely slow tokenization of text matching email <local-part> (before the '@')
@Slow
public void testLongEMAILatomText() throws Exception {
// EMAILatomText = [A-Za-z0-9!#$%&'*+-/=?\^_`{|}~]
char[] emailAtomChars

View File

@ -17,6 +17,7 @@ package org.apache.lucene.util;
* limitations under the License.
*/
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@ -94,6 +95,7 @@ import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.FilterDirectory;
import org.apache.lucene.store.NoLockFactory;
import org.junit.Assert;
import com.carrotsearch.randomizedtesting.generators.RandomInts;
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
@ -111,6 +113,7 @@ public final class TestUtil {
* Closes the given InputStream after extracting!
*/
public static void unzip(InputStream in, Path destDir) throws IOException {
in = new BufferedInputStream(in);
IOUtils.rm(destDir);
Files.createDirectory(destDir);