[ 
https://issues.apache.org/jira/browse/LUCENE-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254583#comment-13254583
 ] 

Uwe Schindler edited comment on LUCENE-3990 at 4/16/12 8:41 AM:
----------------------------------------------------------------

We should have a asserting method for CharFilter consistency. Indeed the 
read(char[],int,int) method in MappingCharFilter is failing horribly (which is 
caused by the underlying MockCharFilter somehow).

I propose to adda CharFilter consistency method that reads two instances of the 
same CharFilter, one using read() and in parallel using read(char[]) with 
varying buffer sizes. It should check offsets (and that is what is heavy buggy 
in MappingCharOffsetCorrumpter / MockCharCorrumpter).

I'll prepare a patch with the test method in BaseTokenStreamTestCase.
                
      was (Author: thetaphi):
    We should have a asserting method for CharFilter consistency. Indeed the 
read(char[],int,int) method in MappingCharFilter is failing horribly.

I propose to adda CharFilter consistency method that reads two instances of the 
same CharFilter, one using read() and in parallel using read(char[]) with 
varying buffer sizes. It should check offsets (and that is what is heavy buggy 
in MappingCharOffsetCorrumpter).

I'll prepare a patch with the test method in BaseTokenStreamTestCase.
                  
> TestRandomChains failure caused by incorrect delegation in 
> CharReader/CharFilter/CharStream API
> -----------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3990
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3990
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: modules/analysis
>            Reporter: Steven Rowe
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3990-CharFilterFix.patch, LUCENE-3990.patch, 
> analysis-common.tests-report.txt
>
>
> 100% reproduces for me:
> 2> NOTE: reproduce with: ant test -Dtests.class=*.TestRandomChains 
> -Dtests.method=testRandomChains -Dtests.seed=88CA02C2BB7B1DA 
> -Dargs="-Dfile.encoding=UTF-8"
> Running org.apache.lucene.analysis.core.TestRandomChains
> FAILURE 7.22s | TestRandomChains.testRandomChains
>    > Throwable #1: java.lang.AssertionError: endOffset 1 expected:<7> but 
> was:<8>
>    >    at 
> __randomizedtesting.SeedInfo.seed([88CA02C2BB7B1DA:356D894D6CA5AC1A]:0)
>    >    at org.junit.Assert.fail(Assert.java:93)
>    >    at org.junit.Assert.failNotEquals(Assert.java:647)
>    >    at org.junit.Assert.assertEquals(Assert.java:128)
>    >    at org.junit.Assert.assertEquals(Assert.java:472)
>    >    at 
> org.apache.lucene.analysis.BaseTokenStreamTestCase.assertTokenStreamContents(BaseTokenStreamTestCase.java:165)
>    >    at 
> org.apache.lucene.analysis.BaseTokenStreamTestCase.checkAnalysisConsistency(BaseTokenStreamTestCase.java:662)
>    >    at 
> org.apache.lucene.analysis.BaseTokenStreamTestCase.checkRandomData(BaseTokenStreamTestCase.java:486)
>    >    at 
> org.apache.lucene.analysis.BaseTokenStreamTestCase.checkRandomData(BaseTokenStreamTestCase.java:429)
>    >    at 
> org.apache.lucene.analysis.core.TestRandomChains.testRandomChains(TestRandomChains.java:820)
> The root cause of this is inconsequent override of several Reader methods in 
> subclasses of CharFilter. We should fix this urgently, thanks to the random 
> chains we found this bug.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to