lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-4212) Tests should not use new Random() without args
Date Wed, 11 Jul 2012 18:13:36 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-4212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Robert Muir updated LUCENE-4212:
--------------------------------

    Attachment: LUCENE-4212.patch

Another buggy case in the MockRandomPostingsFormat: today we do sometimes use the no-arg ctor
at write time
(should only be used for read!), specifically if you use -Dtests.postingsformat=MockRandom

This results in unseeded behavior, not good. With the previous patch you get NPE (a little
confusing)

Updated patch throws IAE in this case, and I fixed LuceneTestCase to pass the seed to MockRandom
if you use this -D option.

                
> Tests should not use new Random() without args
> ----------------------------------------------
>
>                 Key: LUCENE-4212
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4212
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/build
>            Reporter: Robert Muir
>         Attachments: LUCENE-4212.patch, LUCENE-4212.patch, LUCENE-4212.patch
>
>
> They should be using random() etc, and if they create one, it should pass in a seed.
> Otherwise, they probably won't reproduce.

--
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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message