Fix test failure that was due to rounding errors.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1722363 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrien Grand 2015-12-30 15:45:54 +00:00
parent 10cdcf6f9b
commit fd765b6252
1 changed files with 1 additions and 6 deletions

View File

@ -286,12 +286,7 @@ public class TestBooleanRewrites extends LuceneTestCase {
Query query = randomQuery(); Query query = randomQuery();
final TopDocs td1 = searcher1.search(query, 100); final TopDocs td1 = searcher1.search(query, 100);
final TopDocs td2 = searcher2.search(query, 100); final TopDocs td2 = searcher2.search(query, 100);
try {
assertEquals(td1, td2); assertEquals(td1, td2);
} catch (AssertionError e) {
System.out.println(query);
throw e;
}
} }
searcher1.getIndexReader().close(); searcher1.getIndexReader().close();
@ -320,7 +315,7 @@ public class TestBooleanRewrites extends LuceneTestCase {
private Query randomQuery() { private Query randomQuery() {
if (random().nextInt(10) == 0) { if (random().nextInt(10) == 0) {
return new BoostQuery(randomQuery(), random().nextFloat()); return new BoostQuery(randomBooleanQuery(), TestUtil.nextInt(random(), 1, 10));
} }
switch (random().nextInt(6)) { switch (random().nextInt(6)) {
case 0: case 0: