lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: failure in TestTrieRangeQuery
Date Tue, 03 Feb 2009 21:13:45 GMT

OK, no problem, thanks for fixing so quickly!

Mike

Uwe Schindler wrote:

> Hi Mike,
>
> I fixed the test. The problem was as you noted because of the both- 
> sides
> exclusive range:
>
>      assertEquals("Returned count of range query must be equal to  
> exclusive
> range length", tTopDocs.totalHits, Math.max(upper-lower-1, 0) );
>
> Your fix was not enough, because the test then would fail, if
> upper==lower==9999, because 10000 cannot be found in index.
>
> Sorry for two commits, my first fix was one Math.max() too much :)
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
>> -----Original Message-----
>> From: Michael McCandless [mailto:lucene@mikemccandless.com]
>> Sent: Tuesday, February 03, 2009 9:16 PM
>> To: java-dev@lucene.apache.org
>> Subject: failure in TestTrieRangeQuery
>>
>>
>> I just had this failure happen:
>>
>>     [junit] Testcase:
>> testRangeSplit_4bit 
>> (org.apache.lucene.search.trie.TestTrieRangeQuery):
>> FAILED
>>     [junit] Returned count of range query must be equal to exclusive
>> range length expected:<0> but was:<-1>
>>     [junit] junit.framework.AssertionFailedError: Returned count of
>> range query must be equal to exclusive range length expected:<0> but
>> was:<-1>
>>     [junit] 	at
>> org
>> .apache
>> .lucene
>> .search 
>> .trie.TestTrieRangeQuery.testRangeSplit(TestTrieRangeQuery.java:
>> 203)
>>     [junit] 	at
>> org
>> .apache
>> .lucene
>> .search
>> .trie.TestTrieRangeQuery.testRangeSplit_4bit(TestTrieRangeQuery.java:
>> 220)
>>
>> It's not repeatable, which is fine (because the test has randomness,
>> which we should leave in there).
>>
>> I think it's a false failure; it happened because upper and lower  
>> were
>> the same value.
>>
>> Uwe does that sound right?  If so maybe we can just add this:
>>
>>   if (upper == lower) {
>>     upper = 1+lower;
>>   }
>>
>> ?
>>
>> Mike
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message