You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Han Jiang <ji...@gmail.com> on 2012/06/02 20:00:01 UTC

Suppressing list doesn't take effect when -Dtests.postingsformat is used

To reproduce the error, here is the command line:

$ ant test-core -Dtests.postingsformat=MockFixedIntBlock

I think this should generate a successful report, since MockFixedIntBlock
is in the suppressing list in TestPostingsOffsets.java. And we should
ignore this testcase.

-- 
Han Jiang

EECS, Peking University, China
Every Effort Creates Smile

Senior Student

Re: Suppressing list doesn't take effect when -Dtests.postingsformat is used

Posted by Han Jiang <ji...@gmail.com>.
Thank you David, currently I just manually remove those testcases when
doing tests...

Hmm, seems that getName() is not allowed to override, then can we make use
of "toString()" to record the information? When judging whether a codec is
to be suppressed, check getName() first, and if it matches 'Lucene40',
check toString() to parse out the real postings format.

On Sun, Jun 3, 2012 at 5:16 AM, Dawid Weiss <da...@cs.put.poznan.pl>wrote:

> The actual source of the problem is that suppression applies to
> codec.getName and enforcing a TEST_POSTINGSFORMAT means  Lucene40Codec
> is created which always returns Lucene40 from getName(). A simple fix
> would be to allow changing the returned name for Lucene40.
> Alternatively, we can do suppression checks more intelligent...
> Suggestions welcome.
>
> Dawid
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>


-- 
Han Jiang

EECS, Peking University, China
Every Effort Creates Smile

Senior Student

Re: Suppressing list doesn't take effect when -Dtests.postingsformat is used

Posted by Dawid Weiss <da...@cs.put.poznan.pl>.
Robert's patch looks good to me. Perhaps we could just move the entire
assumption to that rule (I don't have the code open so I don't know
where this is called, but I think it should be determined as soon as
possible and once).

Dawid

On Sun, Jun 3, 2012 at 9:54 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
>> The actual source of the problem is that suppression applies to codec.getName
>> and enforcing a TEST_POSTINGSFORMAT means  Lucene40Codec is created
>> which always returns Lucene40 from getName(). A simple fix would be to allow
>> changing the returned name for Lucene40.
>
> I don't think we should do this! Making it un-final destroys the whole concept behind it. SPI relies on a constant name and this enforces the codec API to behave correctly. If it can suddenly return a different name the consistency between codec file format and loaded codec is no longer preserved.
>
> Uwe
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>

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


RE: Suppressing list doesn't take effect when -Dtests.postingsformat is used

Posted by Uwe Schindler <uw...@thetaphi.de>.
> The actual source of the problem is that suppression applies to codec.getName
> and enforcing a TEST_POSTINGSFORMAT means  Lucene40Codec is created
> which always returns Lucene40 from getName(). A simple fix would be to allow
> changing the returned name for Lucene40.

I don't think we should do this! Making it un-final destroys the whole concept behind it. SPI relies on a constant name and this enforces the codec API to behave correctly. If it can suddenly return a different name the consistency between codec file format and loaded codec is no longer preserved.

Uwe


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


Re: Suppressing list doesn't take effect when -Dtests.postingsformat is used

Posted by Robert Muir <rc...@gmail.com>.
On Sat, Jun 2, 2012 at 11:16 PM, Dawid Weiss
<da...@cs.put.poznan.pl> wrote:
> The actual source of the problem is that suppression applies to
> codec.getName and enforcing a TEST_POSTINGSFORMAT means  Lucene40Codec
> is created which always returns Lucene40 from getName(). A simple fix
> would be to allow changing the returned name for Lucene40.
> Alternatively, we can do suppression checks more intelligent...
> Suggestions welcome.
>

I don't think we should do that, because getName() is for the SPI.

I have an alternate patch: https://issues.apache.org/jira/browse/LUCENE-4102

Thanks for reporting this!


-- 
lucidimagination.com

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


Re: Suppressing list doesn't take effect when -Dtests.postingsformat is used

Posted by Dawid Weiss <da...@cs.put.poznan.pl>.
The actual source of the problem is that suppression applies to
codec.getName and enforcing a TEST_POSTINGSFORMAT means  Lucene40Codec
is created which always returns Lucene40 from getName(). A simple fix
would be to allow changing the returned name for Lucene40.
Alternatively, we can do suppression checks more intelligent...
Suggestions welcome.

Dawid

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